app\HasRoles::assignRole PHP Méthode

assignRole() public méthode

Assign the given role to the user.
public assignRole ( string $role ) : mixed
$role string
Résultat mixed
    public function assignRole($role)
    {
        return $this->roles()->save(Role::whereName($role)->firstOrFail());
    }