Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

SOLVED: Laravel manual login function

Stack User:

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.



Posted in S.E.F
via StackOverflow & StackExchange Atomic Web Robots
This Question have been answered
HERE


This post first appeared on Stack Solved, please read the originial post: here

Share the post

SOLVED: Laravel manual login function

×

Subscribe to Stack Solved

Get updates delivered right to your inbox!

Thank you for your subscription

×