add badge logic

This commit is contained in:
root
2026-04-25 01:23:21 -04:00
parent eafe4eb134
commit 5c544f93b9
13 changed files with 1468 additions and 169 deletions
@@ -9,14 +9,14 @@ class RolePermissionResource extends JsonResource
public function toArray($request): array
{
return [
'permission_id' => (int) ($this['id'] ?? $this['permission_id'] ?? 0),
'name' => (string) ($this['name'] ?? ''),
'description' => $this['description'] ?? null,
'can_create' => (int) ($this['can_create'] ?? 0),
'can_read' => (int) ($this['can_read'] ?? 0),
'can_update' => (int) ($this['can_update'] ?? 0),
'can_delete' => (int) ($this['can_delete'] ?? 0),
'can_manage' => (int) ($this['can_manage'] ?? 0),
'permission_id' => (int) ($this->id ?? $this->permission_id ?? $this['id'] ?? $this['permission_id'] ?? 0),
'name' => (string) ($this->name ?? $this['name'] ?? ''),
'description' => $this->description ?? $this['description'] ?? null,
'can_create' => (int) ($this->can_create ?? $this['can_create'] ?? 0),
'can_read' => (int) ($this->can_read ?? $this['can_read'] ?? 0),
'can_update' => (int) ($this->can_update ?? $this['can_update'] ?? 0),
'can_delete' => (int) ($this->can_delete ?? $this['can_delete'] ?? 0),
'can_manage' => (int) ($this->can_manage ?? $this['can_manage'] ?? 0),
];
}
}