Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error Illuminate\Database\Query\Builder::getAuthIdentifierName()

Tags:

laravel

I just create a model user.php on source app and when I reloaded the serve appear this error

Call to undefined method Illuminate\Database\Query\Builder::getAuthIdentifierName()

Thanks for the help!

like image 331
jlgf Avatar asked Dec 02 '22 11:12

jlgf


1 Answers

Check if user table contains primary key as 'id' and User model extends proper interfaces like Authenticatable.

use Illuminate\Foundation\Auth\User as Authenticatable;

class User extends Authenticatable
like image 82
Madhav Chaturvedi Avatar answered Dec 26 '22 09:12

Madhav Chaturvedi