New-OMIS/Modules/Leave/app/Repositories/LeaveRepository.php

35 lines
633 B
PHP
Raw Permalink Normal View History

2024-04-05 04:33:35 +00:00
<?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)
{
2024-04-05 12:11:16 +00:00
return Leave::where('leave_id',$leaveId)->update($newDetails);
2024-04-05 04:33:35 +00:00
}
}