Files
shahrzadzandi09/app/Http/Requests/EditProfilePostRequest.php
T
2026-08-20 08:15:20 +03:30

58 lines
1.3 KiB
PHP

<?php
namespace App\Http\Requests;
use Illuminate\Contracts\Validation\ValidationRule;
use Illuminate\Foundation\Http\FormRequest;
class EditProfilePostRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array<string, ValidationRule|array<mixed>|string>
*/
public function rules(): array
{
return [
'name' =>
[
'required',
'string',
'max:255'
],
'username' =>
[
'required',
'string',
'max:255',
'unique:users,username,' . $user->id,
],
'email' => [
'required',
'email',
'max:255',
'unique:users,email,' . $user->id,
],
'password' =>
[
'nullable',
'string',
'min:8',
'confirmed'
],
];
}
}