mirror of
https://github.com/NNTmux/newznab-tmux.git
synced 2026-08-28 22:01:33 +00:00
27 lines
811 B
PHP
27 lines
811 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Http\Requests;
|
|
|
|
use App\Rules\ValidEmailDomain;
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
class UpdateProfileRequest extends FormRequest
|
|
{
|
|
/**
|
|
* @return array<string, mixed>
|
|
*/
|
|
public function rules(): array
|
|
{
|
|
$userId = $this->user()?->id;
|
|
|
|
return [
|
|
'email' => ['nullable', 'string', 'email', 'max:255', 'unique:users,email,'.$userId, new ValidEmailDomain],
|
|
'password' => ['nullable', 'string', 'min:8', 'confirmed', 'regex:/^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[#?!@$%^&*-]).{8,}$/'],
|
|
'theme_preference' => ['sometimes', 'in:light,dark,system'],
|
|
'color_scheme' => ['sometimes', 'in:blue,indigo,cyan,teal,emerald,violet,pink,rose,red,orange,amber'],
|
|
];
|
|
}
|
|
}
|