<?php
 namespace App\Http\Requests\Admin; use Illuminate\Foundation\Http\FormRequest; class CouponIndexRequest extends FormRequest { public function authorize(): bool { return $this->user()->can('viewAny', \App\Models\Coupon::class); } public function rules(): array { return [ 'search' => 'nullable', 'search.value' => 'nullable|string|max:255', 'type' => 'nullable|in:percentage,fixed', 'status' => 'nullable|in:active,inactive,expired,not_started,limit_reached', 'currency_id' => 'nullable|exists:currencies,id', ]; } public function messages(): array { return [ 'type.in' => 'Geçersiz kupon tipi.', 'status.in' => 'Geçersiz durum.', 'currency_id.exists' => 'Geçersiz para birimi.', ]; } } 