StocksNew/Modules/Attendance/app/Repositories/AttendanceRepository.php

36 lines
735 B
PHP
Raw Normal View History

2024-08-27 12:03:06 +00:00
<?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);
}
}