app/Http/Controllers/Auth/RegisteredUserController.php
/**
     * Handle an incoming registration request.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return \Illuminate\Http\RedirectResponse
     *
     * @throws \Illuminate\Validation\ValidationException
     */
Handle an incoming registration request.


Handle an incoming registration request .
public function store(Request $request)
    {
        $request->validate([
            'name' => ['required', 'string', 'max:255'],
            'email' => ['required', 'string', 'email', 'max:255', 'unique:users'],
            'password' => ['required', 'confirmed', Rules\Password::defaults()],
        ]);
        $user = User::create([
            'user_name' => $request->name,
            'email' => $request->email,
            'password' => Hash::make($request->password),
        ]);
        event(new Registered($user));
        DB::update('update users set user_name = ? where email = ?',[$request->name,$request->email]);
        Auth::login($user);
       return redirect(RouteServiceProvider::HOME);
    }
public function store ( Request $ request ) { $ request -> validate ( [ 'name' => [ 'required' , 'string' , 'max:255' ] , 'email' => [ 'required' , 'string' , 'email' , 'max:255' , 'unique:users' ] , 'password' => [ 'required' , 'confirmed' , Rules \ Password :: defaults ( ) ] , ] ) ; $ user = User :: create ( [ 'user_name' => $ request -> name , 'email' => $ request -> email , 'password' => Hash :: make ( $ request -> password ) , ] ) ; event ( new Registered ( $ user ) ) ; DB :: update ( 'update users set user_name = ? where email = ?' , [ $ request -> name , $ request -> email ] ) ; Auth :: login ( $ user ) ; return redirect ( RouteServiceProvider :: HOME ) ; }
Handle an incoming registration request.
Handle an incoming registration request .