|string> */ public function rules(): array { // Get the user model instance from the route $user = $this->route('user'); return [ 'name' => ['string', 'max:50'], 'email' => ['nullable', 'string', 'email', Rule::unique('users', 'email')->ignore($user->id)], 'password' => ['nullable', 'string', Password::default()], 'currentPassword' => ['nullable', 'required_with:password', 'string', Password::default()], ]; } }