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