Closed Giacomo92 closed 6 years ago
Hello ,
First you model must extends from Jenssegers\Mongodb\Eloquent\Model
Second you have to use HasRoles
Trait
Third, use Maklad\Permission\Models Permission
instead of Spatie\Permission\Models\Permission
in config/permission.php
namespace App\Models\Auth\User;
use Jenssegers\Mongodb\Eloquent\Model as Eloquent;
use Jenssegers\Mongodb\Eloquent\SoftDeletes;
use Maklad\Permission\Traits\HasRoles;
class User extends Eloquent{
protected $connection = 'mongodb';
protected $table = 'users';
use SoftDeletes;
use HasRoles;
protected $dates = ['deleted_at', 'created_at', 'updated_at'];
}
My problem was due to the preesistent version of Laravel Permission by Spatie conflict with the new installation. After I cleaned my project all it is working. Thank you @mostafamaklad
You are welcome @Giacomo92
When I try to install I get this error:
This is my user model:
I have also created the users collection on the DB
How can I fix this?