コード例 #1
0
 /**
  *	Function to delete a author 
  *
  *	@param id: id of category want delete
  */
 public function destroy()
 {
     if (Request::ajax()) {
         $requesAll = Request::all();
         $id = Request::get('id');
         $user = User::findOrFail($id);
         $user->delete();
         echo $id;
     }
 }
コード例 #2
0
 /**
  *	Author page
  */
 public function authorIndex($id)
 {
     $articles_user = Article::where('user_id', $id)->simplePaginate(5);
     $author = User::find($id);
     return view('front-end.pages.author', compact('articles_user', 'author'));
 }
コード例 #3
0
 /**
  * Create a new user instance after a valid registration.
  *
  * @param  array  $data
  * @return User
  */
 protected function create(array $data)
 {
     return User::create(['name' => $data['name'], 'email' => $data['email'], 'password' => bcrypt($data['password'])]);
 }