koel/app/Http/Requests/API/ProfileUpdateRequest.php
2021-05-21 19:14:00 +02:00

23 lines
567 B
PHP

<?php
namespace App\Http\Requests\API;
use Illuminate\Validation\Rules\Password;
/**
* @property-read string|null $current_password
* @property-read string|null $new_password
*/
class ProfileUpdateRequest extends Request
{
/** @return array<mixed> */
public function rules(): array
{
return [
'name' => 'required',
'email' => 'required|email|unique:users,email,' . auth()->user()->id,
'current_password' => 'required',
'new_password' => ['sometimes', Password::defaults()],
];
}
}