user and role relationship caused problem with Spatie package
The relationship caused problems We should not write this many to many relationship inside User's model if we use Spatie permissions package
public function roles()
{
    return $this->belongsToMany(Role::class, 'model_has_roles', 'model_id', 'role_id');
}
by Valeri Tandilashvili
4 years ago
Laravel
2
Pro tip: use ```triple backticks around text``` to write in code fences