New-OMIS/Modules/Leave/app/Repositories/LeaveRepository.php
2024-04-05 17:56:16 +05:45

35 lines
633 B
PHP

<?php
namespace Modules\Leave\Repositories;
use Modules\Leave\Models\Leave;
class LeaveRepository implements LeaveInterface
{
public function findAll()
{
return Leave::get();
}
public function getLeaveById($leaveId)
{
return Leave::findOrFail($leaveId);
}
public function delete($leaveId)
{
Leave::destroy($leaveId);
}
public function create(array $leaveDetails)
{
return Leave::create($leaveDetails);
}
public function update($leaveId, array $newDetails)
{
return Leave::where('leave_id',$leaveId)->update($newDetails);
}
}