samedi 8 juillet 2017

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

I have installed Laravel 5.4 and used the php artisan make:auth. Everything was all fine, I set up my database and migrate verything. I also tested the login and registration and it was working perfectly.

After that I managed to set up my other controllers and models. After I tested one of the controller (Basically, I store an image in the database and then display it). And it worked fine I stored the image and then displayed it.

However, since then I receive an error when I try to login or register.

When I try to access http://localhost:8000/login or http://localhost:8000/register I receive the follwoing error:

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

For this one I am not entirely sure which part of my code I should share but this is my Modal User.php:

namespace App;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Notifications\Notifiable;
use Illuminate\Foundation\Auth\User as Authenticatable;

use App\User;

class User extends Authenticatable
{
use Notifiable;

/**
 * The attributes that are mass assignable.
 *
 * @var array
 */


protected $table = 'users';

protected $fillable = [
    'name', 'email', 'password',
];

/**
 * The attributes that should be hidden for arrays.
 *
 * @var array
 */
protected $hidden = [
    'password', 'remember_token',
];
}

Thank you in advance guys, if you need other parts of my code I will be happy to share.



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2sYnsjS
via IFTTT

Aucun commentaire:

Enregistrer un commentaire