[]]], parameters: [new OA\Parameter(name: 'per_page', in: 'query', required: false, schema: new OA\Schema(type: 'integer', default: 15))], responses: [new OA\Response(response: 200, description: 'Slide listesi')], )] public function index(Request $request): AnonymousResourceCollection { $slides = $this->repository->paginate( $request->only([]), $request->integer('per_page', 15), ); return HeroSlideResource::collection($slides); } #[OA\Post( path: '/api/admin/hero-slides', summary: 'Yeni hero slide oluştur', tags: ['Admin - Hero Slides'], security: [['sanctum' => []]], requestBody: new OA\RequestBody(required: true, content: new OA\JsonContent( required: ['title', 'image'], properties: [ new OA\Property(property: 'title', type: 'string'), new OA\Property(property: 'subtitle', type: 'string'), new OA\Property(property: 'image', type: 'string'), new OA\Property(property: 'mobile_image', type: 'string'), new OA\Property(property: 'button_text', type: 'string'), new OA\Property(property: 'button_url', type: 'string'), new OA\Property(property: 'is_active', type: 'boolean'), new OA\Property(property: 'sort_order', type: 'integer'), ], )), responses: [ new OA\Response(response: 201, description: 'Slide oluşturuldu'), new OA\Response(response: 422, description: 'Validasyon hatası'), ], )] public function store(StoreHeroSlideRequest $request, CreateHeroSlideAction $action): JsonResponse { $dto = HeroSlideData::fromArray($request->validated()); $slide = $action->execute($dto); return response()->json(new HeroSlideResource($slide), 201); } #[OA\Get( path: '/api/admin/hero-slides/{heroSlide}', summary: 'Hero slide detayı', tags: ['Admin - Hero Slides'], security: [['sanctum' => []]], parameters: [new OA\Parameter(name: 'heroSlide', in: 'path', required: true, schema: new OA\Schema(type: 'integer'))], responses: [new OA\Response(response: 200, description: 'Slide detayı')], )] public function show(HeroSlide $heroSlide): JsonResponse { return response()->json(new HeroSlideResource($heroSlide)); } #[OA\Put( path: '/api/admin/hero-slides/{heroSlide}', summary: 'Hero slide güncelle', tags: ['Admin - Hero Slides'], security: [['sanctum' => []]], parameters: [new OA\Parameter(name: 'heroSlide', in: 'path', required: true, schema: new OA\Schema(type: 'integer'))], requestBody: new OA\RequestBody(required: true, content: new OA\JsonContent( properties: [ new OA\Property(property: 'title', type: 'string'), new OA\Property(property: 'subtitle', type: 'string'), new OA\Property(property: 'image', type: 'string'), new OA\Property(property: 'button_text', type: 'string'), new OA\Property(property: 'button_url', type: 'string'), new OA\Property(property: 'is_active', type: 'boolean'), new OA\Property(property: 'sort_order', type: 'integer'), ], )), responses: [ new OA\Response(response: 200, description: 'Slide güncellendi'), new OA\Response(response: 422, description: 'Validasyon hatası'), ], )] public function update(UpdateHeroSlideRequest $request, HeroSlide $heroSlide, UpdateHeroSlideAction $action): JsonResponse { $dto = HeroSlideData::fromArray(array_merge($heroSlide->toArray(), $request->validated())); $heroSlide = $action->execute($heroSlide, $dto); return response()->json(new HeroSlideResource($heroSlide)); } #[OA\Delete( path: '/api/admin/hero-slides/{heroSlide}', summary: 'Hero slide sil', tags: ['Admin - Hero Slides'], security: [['sanctum' => []]], parameters: [new OA\Parameter(name: 'heroSlide', in: 'path', required: true, schema: new OA\Schema(type: 'integer'))], responses: [new OA\Response(response: 200, description: 'Slide silindi')], )] public function destroy(HeroSlide $heroSlide, DeleteHeroSlideAction $action): JsonResponse { $action->execute($heroSlide); return response()->json(['message' => 'Hero slide silindi.']); } }