If you followed that video, your User model should have these methods:
/**
* User roles.
*
* @return BelongsToMany
*/
public function roles()
{
return $this->belongsToMany(Role::class);
}
/**
* Assign role to user.
*
* @param string $role
*
* @return Role
*/
public function assignRole($role)
{
return $this->roles()->save(
Role::whereName($role)->firstOrFail()
);
}
/**
* Return true if user has given role.
*
* @param string|Collection $role
*
* @return bool
*/
public function hasRole($role)
{
if (is_string($role)) {
return $this->roles->contains('name', $role);
}
return !! $role->intersect($this->roles)->count();
}
Assuming you have the relationship, this should give you a collection of the user's roles.
$user->roles;