public function update(AuthorRequest $request, Author $author) { $author->update($request->all()); session()->flash('flash_message', 'Author was updated with success'); if (Request::wantsJson()) { return $author; } return redirect('authors'); }
/** * Update the specified resource in storage. * * @param Author $author * @return Response */ public function update(Author $author, AuthorRequest $request) { $author->update($request->all()); return $this->respondTo(['html' => redirect('authors'), 'default' => 'Your author was updated with success']); }
/** * Update the specified resource in storage. * * @param AuthorRequest|Request $request * @param Author $author * * @return Response * @internal param int $id */ public function update(AuthorRequest $request, Author $author) { $author->update($request->all()); flash()->success("Author has been successfully updated!"); return redirect()->back()->withInput(); }
public function update($id, AuthorRequest $request) { $author = Author::findOrFail($id); $author->update($request->all()); return redirect('authors'); }