New-OMIS/Modules/Attendance/app/Repositories/AttendanceRepository.php
2024-04-16 17:23:35 +05:45

36 lines
735 B
PHP

<?php
namespace Modules\Attendance\Repositories;
use Modules\Attendance\Models\Attendance;
class AttendanceRepository implements AttendanceInterface
{
public function findAll()
{
return Attendance::get();
}
public function getAttendanceById($attendanceId)
{
return Attendance::findOrFail($attendanceId);
}
public function delete($attendanceId)
{
Attendance::destroy($attendanceId);
}
public function create(array $attendanceDetails)
{
return Attendance::create($attendanceDetails);
}
public function update($attendanceId, array $newDetails)
{
return Attendance::where('attendance_id', $attendanceId)->update($newDetails);
}
}