- Reverts the schneespur/ subdirectory restructure (b8e426b)
- Restores package.json and vite.config.js (needed for npm build, were
removed in an earlier cleanup before the restructure)
- Updates public/build/ assets with current Vite output (new content hashes)
51 lines
1.3 KiB
PHP
51 lines
1.3 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Requests\Admin;
|
|
|
|
use Illuminate\Contracts\Validation\ValidationRule;
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
use Illuminate\Validation\Validator;
|
|
|
|
class AnonymizeDriverRequest extends FormRequest
|
|
{
|
|
public function authorize(): bool
|
|
{
|
|
return true;
|
|
}
|
|
|
|
/**
|
|
* @return array<string, ValidationRule|array<mixed>|string>
|
|
*/
|
|
public function rules(): array
|
|
{
|
|
return [
|
|
'confirmation_name' => ['required', 'string'],
|
|
'reason' => ['required', 'string', 'max:500'],
|
|
];
|
|
}
|
|
|
|
public function withValidator(Validator $validator): void
|
|
{
|
|
$validator->after(function (Validator $validator) {
|
|
$driver = $this->route('driver');
|
|
|
|
if ($driver && $this->input('confirmation_name') !== $driver->name) {
|
|
$validator->errors()->add(
|
|
'confirmation_name',
|
|
__('validation.same', ['attribute' => 'confirmation_name', 'other' => __('driver.field_name')])
|
|
);
|
|
}
|
|
});
|
|
}
|
|
|
|
/**
|
|
* @return array<string, string>
|
|
*/
|
|
public function attributes(): array
|
|
{
|
|
return [
|
|
'confirmation_name' => __('driver.modal_anonymize_confirm_label'),
|
|
'reason' => __('driver.modal_anonymize_reason_label'),
|
|
];
|
|
}
|
|
}
|