model = $p_e_x_i_m; $this->model->setUserFilter(); parent::__construct(); } /** * Display a listing of the resource. * * @return Response */ public function index(PEXIMUserRequest $request) { $p_e_x_i_m_s = $this->model->all(); $this->theme->prependTitle(trans('proba::p_e_x_i_m.names').' :: '); return $this->theme->of('proba::user.p_e_x_i_m.index', compact('p_e_x_i_m_s'))->render(); } /** * Display the specified resource. * * @param Request $request * @param int $id * * @return Response */ public function show(PEXIMUserRequest $request, $role, $id) { $p_e_x_i_m = $this->model->find($id); return $this->theme->of('proba::user.p_e_x_i_m.show', compact('p_e_x_i_m'))->render(); } /** * Show the form for creating a new resource. * * @param Request $request * * @return Response */ public function create(PEXIMUserRequest $request) { $p_e_x_i_m = $this->model->findOrNew(0); Former::populate($p_e_x_i_m); return $this->theme->of('proba::user.p_e_x_i_m.create', compact('p_e_x_i_m'))->render(); } /** * Display the specified resource. * * @param Request $request * * @return Response */ public function store(PEXIMUserRequest $request) { try { $attributes = $request->all(); $p_e_x_i_m = $this->model->create($attributes); return $this->success(trans('messages.success.created', ['Module' => trans('proba::p_e_x_i_m.name')])); } catch (Exception $e) { return $this->error($e->getMessage()); } } /** * Show the form for editing the specified resource. * * @param Request $request * @param int $id * * @return Response */ public function edit(PEXIMUserRequest $request, $role, $id) { $p_e_x_i_m = $this->model->find($id); Former::populate($p_e_x_i_m); return $this->theme->of('proba::user.p_e_x_i_m.edit', compact('p_e_x_i_m'))->render(); } /** * Update the specified resource. * * @param Request $request * @param int $id * * @return Response */ public function update(PEXIMUserRequest $request, $role, $id) { try { $attributes = $request->all(); $p_e_x_i_m = $this->model->update($attributes, $id); return $this->success(trans('messages.success.updated', ['Module' => trans('proba::p_e_x_i_m.name')])); } catch (Exception $e) { return $this->error($e->getMessage()); } } /** * Remove the specified resource. * * @param int $id * * @return Response */ public function destroy(PEXIMUserRequest $request, $role, $id) { try { $this->model->delete($id); return $this->success(trans('message.success.deleted', ['Module' => trans('proba::p_e_x_i_m.name')]), 200); } catch (Exception $e) { return $this->error($e->getMessage()); } } }