romanbican / roles

Powerful package for handling roles and permissions in Laravel 5
MIT License
1.15k stars 296 forks source link

Interface 'App\AuthenticatableContract' not found #150

Open BhautikAjmera007 opened 8 years ago

BhautikAjmera007 commented 8 years ago

How can i solve this bug

devillom commented 8 years ago

if you use laravel 5.2 try

namespace App;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Database\Eloquent\SoftDeletes;
use Bican\Roles\Traits\HasRoleAndPermission;
use Bican\Roles\Contracts\HasRoleAndPermission as HasRoleAndPermissionContract;

class User extends Authenticatable implements HasRoleAndPermissionContract
{
    use HasRoleAndPermission , SoftDeletes;
benpoulson commented 8 years ago

It mentions in the title that he's using it as an interface, you want:

use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract;
class User extends Model implements AuthenticatableContract
{
    use Authenticatable;
}