middleware(function ($request, $next) { $this->form = AcknowledgementDetailForm::grouped(false) ->setAttributes() ->toArray(); $this->modules = $this->modules(config('bixo.account.modules'), 'account', guard_url('account')); return $next($request); }); } /** * Display a list of acknowledgement_detail. * * @return Response */ public function index(AcknowledgementDetailResourceRequest $request) { $request = $request->all(); $page = AcknowledgementDetailActions::run('paginate', $request); $data = new AcknowledgementDetailsCollection($page); $form = $this->form; $modules = $this->modules; return $this->response->setMetaTitle(trans('account::acknowledgement_detail.names')) ->view('account::acknowledgement_detail.index') ->data(compact('data', 'modules', 'form')) ->output(); } /** * Display acknowledgement_detail. * * @param Request $request * @param Model $acknowledgement_detail * * @return Response */ public function show(AcknowledgementDetailResourceRequest $request, AcknowledgementDetail $model) { $form = $this->form; $modules = $this->modules; $data = new AcknowledgementDetailResource($model); return $this->response ->setMetaTitle(trans('app.view') . ' ' . trans('account::acknowledgement_detail.name')) ->data(compact('data', 'form', 'modules')) ->view('account::acknowledgement_detail.show') ->output(); } /** * Show the form for creating a new acknowledgement_detail. * * @param Request $request * * @return Response */ public function create(AcknowledgementDetailResourceRequest $request, AcknowledgementDetail $model) { $form = $this->form; $modules = $this->modules; $data = new AcknowledgementDetailResource($model); return $this->response->setMetaTitle(trans('app.new') . ' ' . trans('account::acknowledgement_detail.name')) ->view('account::acknowledgement_detail.create') ->data(compact('data', 'form', 'modules')) ->output(); } /** * Create new acknowledgement_detail. * * @param Request $request * * @return Response */ public function store(AcknowledgementDetailResourceRequest $request, AcknowledgementDetail $model) { try { $request = $request->all(); $model = AcknowledgementDetailAction::run('store', $model, $request); $data = new AcknowledgementDetailResource($model); return $this->response->message(trans('messages.success.created', ['Module' => trans('account::acknowledgement_detail.name')])) ->code(204) ->data(compact('data')) ->status('success') ->url(guard_url('account/acknowledgement_detail/' . $model->getRouteKey())) ->redirect(); } catch (Exception $e) { return $this->response->message($e->getMessage()) ->code(400) ->status('error') ->url(guard_url('/account/acknowledgement_detail')) ->redirect(); } } /** * Show acknowledgement_detail for editing. * * @param Request $request * @param Model $acknowledgement_detail * * @return Response */ public function edit(AcknowledgementDetailResourceRequest $request, AcknowledgementDetail $model) { $form = $this->form; $modules = $this->modules; $data = new AcknowledgementDetailResource($model); // return view('account::acknowledgement_detail.edit', compact('data', 'form', 'modules')); return $this->response->setMetaTitle(trans('app.edit') . ' ' . trans('account::acknowledgement_detail.name')) ->view('account::acknowledgement_detail.edit') ->data(compact('data', 'form', 'modules')) ->output(); } /** * Update the acknowledgement_detail. * * @param Request $request * @param Model $acknowledgement_detail * * @return Response */ public function update(AcknowledgementDetailResourceRequest $request, AcknowledgementDetail $model) { try { $request = $request->all(); $model = AcknowledgementDetailAction::run('update', $model, $request); $data = new AcknowledgementDetailResource($model); return $this->response->message(trans('messages.success.updated', ['Module' => trans('account::acknowledgement_detail.name')])) ->code(204) ->status('success') ->data(compact('data')) ->url(guard_url('account/acknowledgement_detail/' . $model->getRouteKey())) ->redirect(); } catch (Exception $e) { return $this->response->message($e->getMessage()) ->code(400) ->status('error') ->url(guard_url('account/acknowledgement_detail/' . $model->getRouteKey())) ->redirect(); } } /** * Remove the acknowledgement_detail. * * @param Model $acknowledgement_detail * * @return Response */ public function destroy(AcknowledgementDetailResourceRequest $request, AcknowledgementDetail $model) { try { $request = $request->all(); $model = AcknowledgementDetailAction::run('destroy', $model, $request); $data = new AcknowledgementDetailResource($model); return $this->response->message(trans('messages.success.deleted', ['Module' => trans('account::acknowledgement_detail.name')])) ->code(202) ->status('success') ->data(compact('data')) ->url(guard_url('account/acknowledgement_detail/0')) ->redirect(); } catch (Exception $e) { return $this->response->message($e->getMessage()) ->code(400) ->status('error') ->url(guard_url('account/acknowledgement_detail/' . $model->getRouteKey())) ->redirect(); } } }