app/Http/Controllers/UsersController.php
/**
   * Store a newly created resource in storage.
   *
   * @param  \Illuminate\Http\Request  $request
   * @return \Illuminate\Http\Response
   */
Store a newly created resource in storage.
Store a newly created resource in storage .
public function store(Request $request)
  {
    $this->validator($request);
    $novoUser = new User();
    $novoUser->name = $request->name;
    $novoUser->email = $request->email;
    $novoUser->password = Hash::make($request->password);
    $novoUser->save();
    return redirect()
      ->route('users.index')
      ->with('success', 'Usuário cadastrado com sucesso!');
  }
public function store ( Request $ request ) { $ this -> validator ( $ request ) ; $ novoUser = new User ( ) ; $ novoUser -> name = $ request -> name ; $ novoUser -> email = $ request -> email ; $ novoUser -> password = Hash :: make ( $ request -> password ) ; $ novoUser -> save ( ) ; return redirect ( ) -> route ( 'users.index' ) -> with ( 'success' , 'Usuário cadastrado com sucesso!') ; }
Store a newly created resource in storage.
Store a newly created resource in storage .