feat(food): implement FoodFormController and FoodFormService; add FoodFormResource for managing food options and routes
This commit is contained in:
@@ -12,6 +12,14 @@ class FoodResource extends JsonResource
|
||||
/** @return array<string, mixed> */
|
||||
public function toArray(Request $request): array
|
||||
{
|
||||
if ($this->resource === null) {
|
||||
return [
|
||||
'id' => null,
|
||||
'name' => 'Comida',
|
||||
'variants' => [],
|
||||
];
|
||||
}
|
||||
|
||||
return [
|
||||
'id' => $this->id,
|
||||
'name' => $this->nombre,
|
||||
|
||||
Reference in New Issue
Block a user