32 lines
964 B
PHP
32 lines
964 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Http\Requests\Api\V1;
|
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
final class StorePersonRequest extends FormRequest
|
|
{
|
|
public function authorize(): bool
|
|
{
|
|
return true;
|
|
}
|
|
|
|
/** @return array<string, mixed> */
|
|
public function rules(): array
|
|
{
|
|
return [
|
|
'crowd_type_id' => ['required', 'ulid', 'exists:crowd_types,id'],
|
|
'first_name' => ['required', 'string', 'max:255'],
|
|
'last_name' => ['required', 'string', 'max:255'],
|
|
'date_of_birth' => ['nullable', 'date', 'before:today'],
|
|
'email' => ['required', 'email', 'max:255'],
|
|
'phone' => ['nullable', 'string', 'max:30'],
|
|
'company_id' => ['nullable', 'ulid', 'exists:companies,id'],
|
|
'status' => ['nullable', 'in:invited,applied,pending,approved,rejected,no_show'],
|
|
'custom_fields' => ['nullable', 'array'],
|
|
];
|
|
}
|
|
}
|