48 lines
1.1 KiB
PHP
48 lines
1.1 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Http\Requests\Back\Users;
|
|
|
|
use App\Http\Requests\Back\Users\Concerns\HasUserRequestRules;
|
|
use Uwil\LaravelBackend\Requests\Users\UpdateUserRequest as BackendUpdateUserRequest;
|
|
|
|
/**
|
|
* Handles authorization and validation for creating a new user.
|
|
*/
|
|
class UpdateUserRequest extends BackendUpdateUserRequest
|
|
{
|
|
use HasUserRequestRules;
|
|
|
|
/**
|
|
* Prepare the data for validation.
|
|
*/
|
|
#[\Override]
|
|
protected function prepareForValidation(): void
|
|
{
|
|
parent::prepareForValidation();
|
|
$this->extraPrepareForValidation();
|
|
}
|
|
|
|
/**
|
|
* Get the validation rules that apply to the request.
|
|
*
|
|
* @return array<string, mixed>
|
|
*/
|
|
#[\Override]
|
|
public function rules(): array
|
|
{
|
|
return array_merge(parent::rules(), $this->extraRules());
|
|
}
|
|
|
|
/**
|
|
* Get custom attributes for validator errors.
|
|
*
|
|
* @return array<string, string>
|
|
*/
|
|
#[\Override]
|
|
public function attributes(): array
|
|
{
|
|
return array_merge(parent::attributes(), $this->extraAttributes());
|
|
}
|
|
}
|