Files
web-probindo/app/Http/Requests/StoreConsultationRequest.php
afriadirahman 8c6dad2a31
tests / ci (push) Canceled after 0s
Admin Panel
2026-09-29 14:57:37 +07:00

36 lines
1.3 KiB
PHP

<?php
namespace App\Http\Requests;
use Illuminate\Contracts\Validation\ValidationRule;
use Illuminate\Foundation\Http\FormRequest;
/**
* A consultation request from one of the public site forms.
*/
class StoreConsultationRequest extends FormRequest
{
/**
* @return array<string, ValidationRule|array<mixed>|string>
*/
public function rules(): array
{
return [
'source' => ['required', 'in:home,services,contact'],
'name' => ['required', 'string', 'max:255'],
'company' => ['nullable', 'string', 'max:255'],
'job_title' => ['nullable', 'string', 'max:255'],
'email' => ['required', 'email', 'max:255'],
'phone' => ['required', 'string', 'max:50'],
'industry' => ['nullable', 'string', 'max:100'],
'service' => ['nullable', 'string', 'max:100'],
'timeline' => ['nullable', 'in:immediate,quarter,midterm,feasibility'],
'details' => ['nullable', 'string', 'max:5000'],
// The full contact form requires agreeing to an NDA first.
'nda_agreed' => ['accepted_if:source,contact'],
// Honeypot: hidden from people, so only bots fill it in.
'website' => ['prohibited'],
];
}
}