40 lines
801 B
PHP
40 lines
801 B
PHP
|
<?php
|
||
|
|
||
|
namespace Modules\Admin\Repositories;
|
||
|
|
||
|
use Modules\Admin\Models\WorkShift;
|
||
|
|
||
|
|
||
|
class WorkShiftRepository implements WorkShiftInterface
|
||
|
{
|
||
|
public function findAll()
|
||
|
{
|
||
|
return WorkShift::get();
|
||
|
}
|
||
|
|
||
|
public function getWorkShiftById($workShiftId)
|
||
|
{
|
||
|
return WorkShift::findOrFail($workShiftId);
|
||
|
}
|
||
|
|
||
|
public function delete($workShiftId)
|
||
|
{
|
||
|
WorkShift::destroy($workShiftId);
|
||
|
}
|
||
|
|
||
|
public function create(array $workShiftDetails)
|
||
|
{
|
||
|
return WorkShift::create($workShiftDetails);
|
||
|
}
|
||
|
|
||
|
public function update($workShiftId, array $newDetails)
|
||
|
{
|
||
|
return WorkShift::where('work_shift_id', $workShiftId)->update($newDetails);
|
||
|
}
|
||
|
|
||
|
public function pluck(){
|
||
|
return WorkShift::pluck('name','work_shift_id');
|
||
|
}
|
||
|
|
||
|
}
|