34 lines
839 B
PHP
Executable File
34 lines
839 B
PHP
Executable File
<?php
|
|
|
|
namespace App\Http\Requests\Settings;
|
|
|
|
use App\Concerns\ProfileValidationRules;
|
|
use Illuminate\Contracts\Validation\ValidationRule;
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
use Illuminate\Support\Str;
|
|
|
|
class ProfileUpdateRequest extends FormRequest
|
|
{
|
|
use ProfileValidationRules;
|
|
|
|
/**
|
|
* Prepare the data for validation.
|
|
*/
|
|
protected function prepareForValidation(): void
|
|
{
|
|
if (config('fortify.lowercase_usernames') && is_string($this->input('email'))) {
|
|
$this->merge(['email' => Str::lower($this->input('email'))]);
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Get the validation rules that apply to the request.
|
|
*
|
|
* @return array<string, ValidationRule|array<mixed>|string>
|
|
*/
|
|
public function rules(): array
|
|
{
|
|
return $this->profileRules($this->user()->id);
|
|
}
|
|
}
|