use auth automatic login on register
snippet in php

use auth automatic login on register

user9749

// do not forget validation!
$this->validate($request, [
            'name' => 'required|max:255',
            'email' => 'required|email|max:255|unique:users',
            'password' => 'required|confirmed|min:6',
        ]);

$data = $request->all();

$user = User::create([
            'name' => $data['name'],
            'email' => $data['email'],
            'password' => bcrypt($data['password']),
        ]);
Auth::login($user);