如何在laravel中修复界面“App \ Illuminate \ Contracts \ Auth \ Aunthenticatable'未找到”

时间:2017-04-17 02:29:52

标签: php laravel

这是我的代码:

use Illuminate\Database\Eloquent\Model;

use Illuminate\Auth\Authenticatable;

class Admin extends Model implements Illuminate\Contracts\Auth\Aunthenticatable
{
    use Authenticatable;

}

如何解决此错误?

  

“App \ Illuminate \ Contracts \ Auth \ Aunthenticatable not found”

2 个答案:

答案 0 :(得分:1)

您没有正确导入namespace。请尝试以下代码:

use Illuminate\Database\Eloquent\Model;
use Illuminate\Auth\Authenticatable;
use Illuminate\Contracts\Auth\Authenticatable as AuthContract;

class Admin extends Model implements AuthContract 
{ 
    use Authenticatable;
}

答案 1 :(得分:0)

你应该写这个。希望这能解决您的问题

<?php

    namespace App;

    use Illuminate\Notifications\Notifiable;
    use Illuminate\Foundation\Auth\User as Authenticatable;

    class AdminModelOL extends Authenticatable {

        use Notifiable;
       }

您应该正确导入命名空间