in your migration table should be role_users if not got to the function in your class: class User extends Model....
public function roles() {
return $this->belongsToMany('App\Role', 'your table name','the name of column if different from convention')
}
SO DO: ...return $this->belongsToMany('App\Role', 'role_user');
Should work.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community