/** * Show the form for editing the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function edit($id) { $myDragon = MyDragon::find($id); $this->authorize('owner', $myDragon); /** @noinspection PhpUndefinedMethodInspection */ return view('myDragon.edit')->with('myDragon', $myDragon)->with('dragons', $this->dragonService->getListForSelects())->with('namedTypesArray', $this->dragonService->getIDsThatCanHaveNames()->toJson()); }
/** * Update the specified resource in storage. * * @param Requests\DragonRequest $request * @param int $id * @return \Illuminate\Http\Response */ public function update(Requests\DragonRequest $request, $id) { $dragon = $this->dragonService->update($id, $request->all()); Notification::add('success', $dragon->getPresenter()->fullName . ' updated'); return Redirect::route('dragon.index'); }