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

36 lines
671 B
PHP
Raw Normal View History

2024-04-15 12:16:31 +00:00
<?php
namespace Modules\Admin\Repositories;
use Modules\Admin\Models\Holiday;
class HolidayRepository implements HolidayInterface
{
public function findAll()
{
return Holiday::get();
}
public function getHolidayById($holidayId)
{
return Holiday::findOrFail($holidayId);
}
public function delete($holidayId)
{
Holiday::destroy($holidayId);
}
public function create(array $holidayDetails)
{
return Holiday::create($holidayDetails);
}
public function update($holidayId, array $newDetails)
{
return Holiday::where('holiday_id', $holidayId)->update($newDetails);
}
}