belongsTo(User::class, 'created_by'); } /** * Check if this is a system role that shouldn't be deleted * * @return bool */ public function getIsSystemRoleAttribute() { $systemRoles = ['superadmin', 'super-admin', 'company']; return in_array(strtolower($this->name), $systemRoles); } }