/home/techb158/ileadtechnology.com/SSM/app/Http/Controllers/configuration
NameSizeModeActions
academic/-0755rm
asset/-0755rm
calendar/-0755rm
employee/-0755rm
exam/-0755rm
finance/-0755rm
library/-0755rm
misc/-0755rm
post/-0755rm
reception/-0755rm
student/-0755rm
transport/-0755rm
ConfigurationController.php82480644editdlrm
CustomFieldController.php46000644editdlrm
LocaleController.php58130644editdlrm
PermissionController.php49990644editdlrm
RoleController.php26820644editdlrm
Edit: /home/techb158/ileadtechnology.com/SSM/app/Http/Controllers/configuration/RoleController.php (2682B)
request = $request; $this->repo = $repo; $this->middleware('role:'.config('system.default_role.admin'), ['except' => ['list']]); } /** * Used to get all Roles * @get ("/api/role") * @return Response */ public function index() { return $this->ok($this->repo->paginate($this->request->all())); } /** * List all roles * @get ("/api/role/employee/list") * @return Response */ public function employeeRoleList() { return $this->ok(generateSelectOption($this->repo->employeeRoleList())); } /** * Used to store Role * @post ("/api/role") * @param ({ * @Parameter("name", type="string", required="true", description="Name of Role"), * }) * @return Response */ public function store(RoleRequest $request) { $role = Role::create(['name' => strtolower(request('name'))]); activity('role')->on($role)->withProperties(['attributes' => ['id' => $role->id, 'name' => $role->name]])->log('created'); return $this->success(['message' => trans('configuration.role_added')]); } /** * Used to get Role detail * @post ("/api/role/{id}") * @param ({ * @Parameter("id", type="integer", required="true", description="Id of Role"), * }) * @return Response */ public function show($id) { return $this->ok($this->repo->findOrFail($id)); } /** * Used to delete role * @delete ("/api/role") * @param ({ * @Parameter("id", type="integer", required="true", description="Id of Role to be deleted"), * }) * @return Response */ public function destroy($id) { $role = $this->repo->deletable($id); activity('role')->on($role)->withProperties(['attributes' => ['id' => $role->id, 'name' => $role->name]])->log('deleted'); $this->repo->delete($role); return $this->success(['message' => trans('configuration.role_deleted')]); } }