35 lines
887 B
PHP
35 lines
887 B
PHP
<?php
|
|
|
|
namespace App\Http\Requests\Api\Client;
|
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
class ClientUpdateRequest extends FormRequest
|
|
{
|
|
public function authorize(): bool
|
|
{
|
|
return auth('client')->check();
|
|
}
|
|
|
|
public function rules(): array
|
|
{
|
|
return [
|
|
'fullname' => 'required|string|max:255',
|
|
'phone' => 'required|string|max:20',
|
|
'company' => 'nullable|string|max:255',
|
|
'address' => 'nullable|string|max:500',
|
|
'province_code' => 'nullable|string|max:10',
|
|
'ward_code' => 'nullable|string|max:10',
|
|
'gender' => 'nullable|in:1,2,3',
|
|
];
|
|
}
|
|
|
|
public function messages(): array
|
|
{
|
|
return [
|
|
'fullname.required' => 'Họ tên là bắt buộc',
|
|
'phone.required' => 'Số điện thoại là bắt buộc',
|
|
];
|
|
}
|
|
}
|