feat(food): implement FoodFormController and FoodFormService; add FoodFormResource for managing food options and routes
This commit is contained in:
@@ -12,6 +12,14 @@ class AccommodationResource extends JsonResource
|
||||
/** @return array<string, mixed> */
|
||||
public function toArray(Request $request): array
|
||||
{
|
||||
if ($this->resource === null) {
|
||||
return [
|
||||
'id' => null,
|
||||
'name' => 'Alojamiento',
|
||||
'variants' => [],
|
||||
];
|
||||
}
|
||||
|
||||
$typeAttribute = $this->itemAttributes
|
||||
->first(fn ($itemAttribute) => $itemAttribute->attribute?->codigo === 'tipo_alojamiento');
|
||||
$options = $typeAttribute?->attribute?->options?->keyBy('value') ?? collect();
|
||||
|
||||
Reference in New Issue
Block a user