big update base struktur tahap 1
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Resources\MenuGroup;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
|
||||
class MenuGroupResource extends JsonResource
|
||||
{
|
||||
/**
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function toArray(Request $request): array
|
||||
{
|
||||
return [
|
||||
'id' => $this->id,
|
||||
'tenant_id' => $this->tenant_id,
|
||||
'name' => $this->name,
|
||||
'description' => $this->description,
|
||||
'is_system' => (bool) $this->is_system,
|
||||
'is_active' => (bool) $this->is_active,
|
||||
'tenant' => $this->whenLoaded('tenant', fn () => $this->tenant ? [
|
||||
'id' => $this->tenant->id,
|
||||
'tenant_code' => $this->tenant->tenant_code,
|
||||
'tenant_name' => $this->tenant->tenant_name,
|
||||
] : null),
|
||||
'created_at' => $this->created_at,
|
||||
'updated_at' => $this->updated_at,
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user