belongsTo($this->roleClass); } function getRole() { return $this->role()->first(); } function roleName() { return $this->getRole()->name; } function isRole($name): bool { return $this->roleName() === $name; } }