I use manual login function in Laravel 5.5. Stuck in login. and check all(5 relevant ) Stack links and didn't find any clue on it.
Achievement is once user get registered, automatically sign in that user.
Error is
"Type error: Argument 1 passed to Illuminate\Auth\SessionGuard::login() must implement interface Illuminate\Contracts\Auth\Authenticatable, string given, called in Server/vendor/laravel/framework/src/Illuminate/Auth/AuthManager.php on line 294 ◀"
if ($validator->fails()) {
// $messages = $validator->messages();
return Redirect::to('register')
->withErrors($validator)
->withInput();
} else {
$email = Input::get('email');
$user = new user;
$user->name = Input::get('name');
$user->email = Input::get('email');
$user->password = Hash::make(Input::get('password'));
$user->save();
// $userMail = $user->find($email);
$userMail = User::where('email','=',$email)->first();
Auth::login($userMail->email, TRUE);
am i doing anything wrong. Please guide me.