Advertisement
Guest User

Untitled

a guest
Oct 15th, 2019
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.60 KB | None | 0 0
  1. public function edit($id)
  2.     {
  3.         $authors = Author::findOrFail($id);
  4.         return view('backend.authors.form', compact('authors'));
  5.     }
  6.  
  7.     /**
  8.      * Update the specified resource in storage.
  9.      *
  10.      * @param  \Illuminate\Http\Request  $request
  11.      * @param  int  $id
  12.      * @return \Illuminate\Http\Response
  13.      */
  14.     public function update(Request $request, $id)
  15.     {
  16.         $this->validate($request, [
  17.             'name' => 'required|string'
  18.         ]);
  19.         $authors = Author::findOrFail($id);
  20.         $authors->update($request->all());
  21.         return $authors;
  22.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement