@@ -0,0 +1,35 @@
|
||||
<?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'],
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user