35 lines
633 B
PHP
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);
|
|
}
|
|
|
|
}
|