<?php
 namespace App\Http\Requests\Admin; use Illuminate\Foundation\Http\FormRequest; class ImportRunRequest extends FormRequest { public function authorize(): bool { return true; } public function rules(): array { return [ 'source' => ['required', 'string', 'in:csv,whmcs'], 'entity' => ['required', 'string', 'in:clients,services,domains,invoices'], 'dry_run' => ['nullable', 'boolean'], 'file' => ['required_if:source,csv', 'file', 'mimes:csv,txt', 'max:10240'], 'file_token' => ['nullable', 'string', 'max:64'], 'db_host' => ['required_if:source,whmcs', 'nullable', 'string', 'max:191'], 'db_port' => ['nullable', 'integer', 'between:1,65535'], 'db_name' => ['required_if:source,whmcs', 'nullable', 'string', 'max:191'], 'db_user' => ['required_if:source,whmcs', 'nullable', 'string', 'max:191'], 'db_password' => ['nullable', 'string', 'max:191'], 'db_tls' => ['nullable', 'boolean'], 'mapping' => ['nullable', 'array'], 'mapping.*' => ['nullable', 'string', 'max:191'], 'default_group_id' => ['nullable', 'integer', 'exists:client_groups,id'], 'default_currency_id' => ['nullable', 'integer', 'exists:currencies,id'], 'default_language_id' => ['nullable', 'integer', 'exists:languages,id'], ]; } } 