- 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)
53 lines
1.6 KiB
PHP
53 lines
1.6 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Requests\Admin;
|
|
|
|
use Illuminate\Contracts\Validation\ValidationRule;
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
class UpdateCustomerRequest 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'],
|
|
'contact_name' => ['nullable', 'string', 'max:200'],
|
|
'email' => ['nullable', 'email', 'max:200'],
|
|
'phone' => ['nullable', 'string', 'max:50'],
|
|
'auto_notify_email' => ['boolean'],
|
|
'notification_email' => ['nullable', 'required_if:auto_notify_email,1', 'email', 'max:200'],
|
|
'locale' => ['sometimes', 'in:de,en'],
|
|
];
|
|
}
|
|
|
|
public function messages(): array
|
|
{
|
|
return [
|
|
'notification_email.required_if' => __('customer.validation_notification_email_required'),
|
|
];
|
|
}
|
|
|
|
/**
|
|
* @return array<string, string>
|
|
*/
|
|
public function attributes(): array
|
|
{
|
|
return [
|
|
'name' => __('customer.field_name'),
|
|
'contact_name' => __('customer.field_contact_name'),
|
|
'email' => __('customer.field_email'),
|
|
'phone' => __('customer.field_phone'),
|
|
'auto_notify_email' => __('customer.field_auto_notify'),
|
|
'notification_email' => __('customer.field_notification_email'),
|
|
'locale' => __('customer.field_locale'),
|
|
];
|
|
}
|
|
}
|