StocksNew/Modules/Attendance/app/Repositories/AttendanceRepository.php
Sampanna Rimal 53c0140f58 first commit
2024-08-27 17:48:06 +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);
}
}