コード例 #1
0
 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');
 }
コード例 #2
0
 /**
  * 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']);
 }
コード例 #3
0
 /**
  * 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();
 }
コード例 #4
0
 public function update($id, AuthorRequest $request)
 {
     $author = Author::findOrFail($id);
     $author->update($request->all());
     return redirect('authors');
 }