schneespur/release/schneespur-1.0.2/app/Http/Requests/Admin/StoreDriverRequest.php
Michael 7288b93500 Release v1.0.2: diagnostic infrastructure core
Add neutral diagnostic framework for future reporting modules:
- DiagnosticReporterInterface, Registry, Manager, PayloadSanitizer
- Laravel exception hook in bootstrap/app.php
- Module permission declarations (requires_permissions in module.json)
- Core diagnostic report points (module boot/install/update failures)
- Module documentation update (moduldoku.md)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-18 16:54:11 +00:00

44 lines
1.2 KiB
PHP

<?php
namespace App\Http\Requests\Admin;
use Illuminate\Contracts\Validation\ValidationRule;
use Illuminate\Foundation\Http\FormRequest;
class StoreDriverRequest extends FormRequest
{
public function authorize(): bool
{
return true;
}
/**
* @return array<string, ValidationRule|array<mixed>|string>
*/
public function rules(): array
{
return [
'name' => ['required', 'string', 'max:200'],
'email' => ['required', 'email', 'max:200', 'unique:users'],
'password' => ['required', 'string', 'min:8'],
'phone' => ['nullable', 'string', 'max:50'],
'notes' => ['nullable', 'string'],
'default_vehicle_id' => ['nullable', 'exists:vehicles,id'],
];
}
/**
* @return array<string, string>
*/
public function attributes(): array
{
return [
'name' => __('driver.field_name'),
'email' => __('driver.field_email'),
'password' => __('driver.field_password'),
'phone' => __('driver.field_phone'),
'notes' => __('driver.field_notes'),
'default_vehicle_id' => __('driver.field_default_vehicle'),
];
}
}