UnknownSec Bypass
403
:
/
mnt
/
lmsestudio-instance-vol002
/
lms_f4c3d9ddbf00
/
app
/
Repositories
/
Student
/ [
drwxr-xr-x
]
Menu
Upload
Mass depes
Mass delete
Terminal
Info server
About
name :
CourseHistoryEloquent.php
<?php namespace EstudioLMS\Repositories\Student; use Carbon\Carbon; use EstudioLMS\Models\Student\CourseHistory; use Prettus\Repository\Eloquent\BaseRepository; /** * Class CourseHistoryEloquent * @package EstudioLMS\Repositories\Student */ class CourseHistoryEloquent extends BaseRepository implements CourseHistoryInterface { /** * @inheritDoc */ public function model() { return CourseHistory::class; } /** * @inheritDoc */ public function setCompleted($userId, $courseId) { $this->model ->whereHas('course', function($query) { $query->where('course_status_id', '<>', 2); }) ->where('user_id', '=', $userId) ->where('course_id', '=', $courseId) ->whereNull('completed_at') ->update([ 'completed_at' => Carbon::now() ]); } /** * @return mixed */ public function allUsersWithAvailableCertificates() { return $this->model ->whereNotNull('completed_at') ->with(['customer']) ->groupBy('user_id') ->get(); } /** * @inheritDoc */ public function availableCertificates($userId) { return $this->model ->with(['course']) ->where(function ($query) { return $query->whereHas('course', function ($query) { return $query->where('requirement_certificate_id', '=', 2); }); }) ->where('user_id', '=', $userId) ->whereNotNull('completed_at') ->get(); } /** * @param $userId * @return int */ public function coursesInProgress($userId) { return count($this->model ->where('user_id', '=', $userId) ->whereNull('completed_at') ->get()); } /** * @param $userId * @return int */ public function coursesCompleted($userId) { return count($this->model ->where('user_id', '=', $userId) ->whereNotNull('completed_at') ->get()); } }
Copyright © 2026 - UnknownSec