I have a Role Model
class Role extends EntrustRole
{
public function permissions()
{
return $this->belongsToMany('App\Permission', Config::get('entrust::permission_role_table'));
}
}
Now i would like to delete a certain role
$role = Role::where("display_name",'=', $request->route("role"))->first();
$role->delete() //fails
$role->forceDelete() //also fails
The above returns an error
message www/html/laravel/keybrands/vendor/laravel/framework/ src/Illuminate/Database/Eloquent/Concerns/HasRelationships.php"
"Class name must be a valid object or a string"
The permission model is in the App namespace.
Where could i be going wrong?
belongsManymethod. So, there's your debugging 101 (there's also the whole error stack trace that would give you that particular line as well, make use of it). - Mjh