add badge logic
This commit is contained in:
@@ -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),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user