Inheritance: extends Request
 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');
 }
 public function update(AuthorRequest $request, $id)
 {
     $authors = Authors::find($id);
     $image_name = $authors->photo;
     if ($request->hasFile('photo')) {
         $authors->photo = ClydeUpload::upload($request->file('photo'), $request->file('photo')->getClientOriginalName());
         ClydeUpload::exists($image_name) == true ? ClydeUpload::delete($image_name) : false;
     }
     $authors->name = $request->name;
     $authors->biography = $request->biography;
     $authors->update();
     return redirect()->route('admin.authors.index');
 }
 /**
  * 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();
 }
示例#5
0
 public function update($id, AuthorRequest $request)
 {
     $author = Author::findOrFail($id);
     $author->update($request->all());
     return redirect('authors');
 }