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