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|string|confirmed|min:8',
        ]);
        $user = User::create([
            'name' => $request->name,
            'email' => $request->email,
            'password' => Hash::make($request->password),
        ]);
        $credentials = UserCredentials::create([
            'user_id' => $user->id
        ]);
        $contact = UsersContact::create([
            'user_id' => $user->id,
            'email' => $user->email
        ]);
        event(new Registered($user));
        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|string|confirmed|min:8' , ] ) ; $ user = User :: create ( [ 'name' => $ request -> name , 'email' => $ request -> email , 'password' => Hash :: make ( $ request -> password ) , ] ) ; $ credentials = UserCredentials :: create ( [ 'user_id' => $ user -> id ] ) ; $ contact = UsersContact :: create ( [ 'user_id' => $ user -> id , 'email' => $ user -> email ] ) ; event ( new Registered ( $ user ) ) ; Auth :: login ( $ user ) ; return redirect ( RouteServiceProvider :: HOME ) ; }
Handle an incoming registration request.
Handle an incoming registration request .
// Create User Credentials Model // Create Users Contact