Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

use auth automatic login on register

// 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);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #auth #automatic #login #register
ADD COMMENT
Topic
Name
1+2 =