app\Models\Access\User\Traits\UserAccess::attachRole PHP Метод

attachRole() публичный Метод

Alias to eloquent many-to-many relation's attach() method.
public attachRole ( mixed $role ) : void
$role mixed
Результат void
    public function attachRole($role)
    {
        if (is_object($role)) {
            $role = $role->getKey();
        }
        if (is_array($role)) {
            $role = $role['id'];
        }
        $this->roles()->attach($role);
    }