HEX
Server: LiteSpeed
System: Linux s1049.use1.mysecurecloudhost.com 4.18.0-477.27.2.lve.el8.x86_64 #1 SMP Wed Oct 11 12:32:56 UTC 2023 x86_64
User: xedaptot (3356)
PHP: 8.3.31
Disabled: NONE
Upload Files
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'],
        ];
    }
}