Answer the question
In order to leave comments, you need to log in
How to fix error after garter belongsToMany?
there are fields in the table - users, roles and role_user.
Garter in the User model
public function roles()
{
return $this->belongsToMany('App\Models\Role');
}
BadMethodCallException in Builder.php line 2093:
Call to undefined method Illuminate\Database\Query\Builder::descendants()
Answer the question
In order to leave comments, you need to log in
Either name the table roles_users or
return $this->belongsToMany('App\ Models \Role', 'role_user');
You did not provide the necessary piece of code where you pull this link.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question