app/Http/Controllers/App/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)
    {
        $rules = [
            'name' => ['required', 'string', 'max:255'],
            'email' => ['required', 'string', 'email', 'max:255', 'unique:users'],
            'password' => ['required', 'string', 'min:8', 'confirmed'],
        ];
        $request->validate($rules);
        User::create([
            'name' => $request->get('name'),
            'email' => $request->get('email'),
            'password' => Hash::make($request->get('password')),
        ]);
        return redirect()->route('app.user.index');
    }
public function store ( Request $ request ) { $ rules = [ 'name' => [ 'required' , 'string' , 'max:255' ] , 'email' => [ 'required' , 'string' , 'email' , 'max:255' , 'unique:users' ] , 'password' => [ 'required' , 'string' , 'min:8' , 'confirmed' ] , ] ; $ request -> validate ( $ rules ) ; User :: create ( [ 'name' => $ request -> get ( 'name' ) , 'email' => $ request -> get ( 'email' ) , 'password' => Hash :: make ( $ request -> get ( 'password' ) ) , ] ) ; return redirect ( ) -> route ( 'app.user.index' ) ; }
Store a newly created resource in storage.
Store a newly created resource in storage .