*/ public function toArray(Request $request): array { return [ 'categories' => $this->resource['categories']->map(fn ($category) => [ 'id' => $category->id, 'nombre' => $category->nombre, ])->values(), ]; } }