check(); } /** * Get the validation rules that apply to the request. * * @return array|string> */ public function rules(): array { $user = $this->user(); return [ 'name' => ['required', 'string', 'max:255'], 'email' => [ 'required', 'string', 'lowercase', 'email', 'max:255', Rule::unique('users')->ignore($user->id), ], 'current_password' => ['nullable', 'required_with:new_password', 'current_password'], 'new_password' => ['nullable', 'string', 'min:8', 'confirmed'], ]; } }