37 lines
922 B
PHP
37 lines
922 B
PHP
<?php
|
|
|
|
namespace App\Http\Requests\Club\Customers;
|
|
|
|
use App\Http\Requests\Club\Customers\StoreCustomerRequest;
|
|
use Illuminate\Support\Facades\Auth;
|
|
use Illuminate\Validation\Rule;
|
|
|
|
class UpdateCustomerRequest extends StoreCustomerRequest
|
|
{
|
|
/**
|
|
* Determine if the user is authorized to make this request.
|
|
*
|
|
* @return boolean
|
|
*/
|
|
public function authorize(): bool
|
|
{
|
|
return Auth::guard('club')->check();
|
|
}
|
|
|
|
/**
|
|
* Get the validation rules that apply to the request.
|
|
*
|
|
* @return array
|
|
*/
|
|
public function rules(): array
|
|
{
|
|
return array_merge(parent::rules(), [
|
|
'email' => [
|
|
'required',
|
|
'email:rfc,strict,dns,spoof,filter',
|
|
Rule::unique('users', 'email')->ignore(\optional($this->route('user'))->getRouteKey())
|
|
],
|
|
'password' => 'nullable',
|
|
]);
|
|
}
|
|
}
|