File: /home/xedaptot/ai.naniguide.com/app/Http/Requests/Refactor/Ads/StoreAdCreativeRequest.php
<?php
namespace App\Http\Requests\Refactor\Ads;
use App\Model\AdCreative;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;
class StoreAdCreativeRequest extends FormRequest
{
public function authorize(): bool
{
return true;
}
public function rules(): array
{
return [
'name' => ['required', 'string', 'max:255'],
'type' => ['required', Rule::in(AdCreative::TYPES)],
'headline' => ['nullable', 'string', 'max:255'],
'primary_text' => ['nullable', 'string', 'max:2000'],
'description' => ['nullable', 'string', 'max:500'],
'call_to_action' => ['nullable', Rule::in(array_keys(AdCreative::CTA_OPTIONS))],
'destination_url' => ['nullable', 'string', 'url', 'max:2048'],
'image_url' => ['nullable', 'string', 'max:2048'],
'builder_content' => ['nullable', 'array'],
'ad_template_id' => ['nullable', 'integer', 'exists:ad_templates,id'],
'ad_campaign_id' => ['nullable', 'integer', 'exists:ad_campaigns,id'],
];
}
}