app/Http/Controllers/UserController.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->validate($request, [
            'name' => 'required',
            'email' => 'required',
            'password' => 'required|alphaNum|min:3',
        ]);
        $user = new User();
        $user ->password = Hash::make($request->newPassword);
        $user -> name = $request->name;
        $user -> email =$request->email;
        $user->save(); 
        return redirect()->route('user.index')
                        ->with('success','Admin dodan');
    }
public function store ( Request $ request ) { $ this -> validate ( $ request , [ 'name' => 'required' , 'email' => 'required' , 'password' => 'required|alphaNum|min:3' , ] ) ; $ user = new User ( ) ; $ user -> password = Hash :: make ( $ request -> newPassword ) ; $ user -> name = $ request -> name ; $ user -> email = $ request -> email ; $ user -> save ( ) ; return redirect ( ) -> route ( 'user.index' ) -> with ( 'success' , 'Admin dodan' ) ; }
Store a newly created resource in storage.
Store a newly created resource in storage .