repository->paginate( filters: $request->only('search'), perPage: $request->integer('per_page', 15), ); return CategoryResource::collection($categories); } #[OA\Get( path: '/api/v1/categories/{slug}', summary: 'Kategori detayı', description: 'Slug ile kategori detayını döndürür.', tags: ['Categories'], parameters: [ new OA\Parameter(name: 'slug', in: 'path', required: true, schema: new OA\Schema(type: 'string')), ], responses: [ new OA\Response(response: 200, description: 'Kategori detayı'), new OA\Response(response: 404, description: 'Kategori bulunamadı'), ], )] public function show(string $slug): CategoryResource { $category = $this->repository->findBySlug($slug); abort_if(! $category, 404, 'Kategori bulunamadı.'); return new CategoryResource($category); } }