M
M
MrChen2017-06-15 13:17:51
Laravel
MrChen, 2017-06-15 13:17:51

Why is the loginUsingId function not working in Laravel?

Hello! In Laravel, the function in this code does not work:

if(Auth::loginUsingId(3, true)){
                $cookie = cookie('cookie', 'mid=' . $user[0]['original']['id'] .'&hash=' . $request, 10080, '/');
                return Redirect::back()->cookie($cookie);
            }

This error pops up:
BadMethodCallException in Builder.php line 2443: Call to undefined method Illuminate\Database\Query\Builder::getAuthIdentifierName()

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Igor Makarov, 2017-06-16
@MrChen

It looks like the user class does not implement the contract \Illuminate\Contracts\Auth\Authenticatable

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question