UnknownSec Bypass
403
:
/
mnt
/
lmsestudio-instance-vol002
/
lms_0e1aa7c43416
/
app
/
Repositories
/
Auth
/ [
drwxr-xr-x
]
Menu
Upload
Mass depes
Mass delete
Terminal
Info server
About
name :
UserRepositoryEloquent.php
<?php namespace EstudioLMS\Repositories\Auth; use EstudioLMS\Models\Auth\User; use Illuminate\Support\Facades\Auth; use Prettus\Repository\Eloquent\BaseRepository; /** * Class UserRepositoryEloquent * @package EstudioLMS\Repositories\Auth */ class UserRepositoryEloquent extends BaseRepository implements UserRepository { public function boot() { $role = Auth::user()['roles'][0]['name']; if ($role !== 'owner') { $this->pushCriteria(new UserCriteria()); } } /** * Specify Model class name * * @return string */ public function model() { return User::class; } /** * @param $user_id * @param $post_id * @return mixed */ public function canVotePost($user_id, $post_id) { return $this->model->voted($post_id)->find($user_id); } /** * @return mixed */ public function allInstructors() { return $this->model->with('posts.category') ->inRole(['teacher', 'admin']) ->where('status', '=', true) ->get(); } /** * @return mixed */ public function allStudents() { return $this->model ->isRole('student') ->get(); } /** * @param $id * @return mixed */ public function instructorPosts($id) { return $this->model->with(['posts', 'posts.category']) ->find($id); } /** * @param $role * @return mixed */ public function userByRole($role) { return $this->model->isRole($role)->first(); } /** * @return mixed */ public function listAllUsers() { $baseModel = $this->model->withTrashed() ->join('role_user', 'users.id', '=', 'role_user.user_id') ->join('roles', 'role_user.role_id', '=', 'roles.id') ->select(['users.id', 'users.updated_at', 'users.name', 'users.email', 'users.status', 'users.deleted_at', 'roles.name AS role_name' ,'roles.display_name']); $role = Auth::user()['roles'][0]['name']; if ($role !== 'owner') { $baseModel = $baseModel->where('show_admin', '=', false); } return $baseModel->get(); } /** * @return mixed */ public function withTrashed() { $this->model = $this->model->withTrashed(); return $this; } /** * @param $id * @return mixed */ public function restore($id) { $user = $this->model->withTrashed()->find($id); $user->restore(); return $user; } /** * @param $userId * @return mixed */ public function instructorById($userId) { return $this->model->with('posts.category') ->inRole(['teacher']) ->where('id', '=', $userId) ->get(); } /** * @param mixed $what use true para todos ou o id do usuário em especĂfico. * @return mixed */ public function admins($what) { $result = $this->model ->inRole(['admin', 'superadmin']); if ($what === true) { return $result->get(); } elseif (is_numeric($what)) { $result = $result->where('id', '=', $what); return $result->get(); } } }
Copyright © 2026 - UnknownSec