New-OMIS/Modules/Admin/app/Repositories/AppreciationRepository.php

36 lines
761 B
PHP
Raw Normal View History

2024-04-14 12:44:29 +00:00
<?php
namespace Modules\Admin\Repositories;
use Modules\Admin\Models\Appreciation;
class AppreciationRepository implements AppreciationInterface
{
public function findAll()
{
return Appreciation::get();
}
public function getAppreciationById($appreciationId)
{
return Appreciation::findOrFail($appreciationId);
}
public function delete($appreciationId)
{
Appreciation::destroy($appreciationId);
}
public function create(array $appreciationDetails)
{
return Appreciation::create($appreciationDetails);
}
public function update($appreciationId, array $newDetails)
{
return Appreciation::where('appreciation_id', $appreciationId)->update($newDetails);
}
}