From a074e656b0ec1c0eb129e155eee8d9f49386581b Mon Sep 17 00:00:00 2001 From: Mohammad Alavi Date: Wed, 15 Dec 2021 19:25:09 +0330 Subject: [PATCH] refactor --- .../UI/API/Requests/ForgotPasswordRequest.php | 7 +++++-- .../UI/API/Requests/SendVerificationEmailRequest.php | 6 +++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/app/Containers/AppSection/Authentication/UI/API/Requests/ForgotPasswordRequest.php b/app/Containers/AppSection/Authentication/UI/API/Requests/ForgotPasswordRequest.php index fd3ffee4a..ea1a1c3f3 100644 --- a/app/Containers/AppSection/Authentication/UI/API/Requests/ForgotPasswordRequest.php +++ b/app/Containers/AppSection/Authentication/UI/API/Requests/ForgotPasswordRequest.php @@ -33,8 +33,11 @@ class ForgotPasswordRequest extends Request public function rules(): array { return [ - 'email' => 'required|email|max:255', - 'reseturl' => 'required|max:255|' . Rule::in(config('appSection-authentication.allowed-reset-password-urls')), + 'email' => 'required|email', + 'reseturl' => [ + 'required', + Rule::in(config('appSection-authentication.allowed-reset-password-urls')), + ], ]; } diff --git a/app/Containers/AppSection/Authentication/UI/API/Requests/SendVerificationEmailRequest.php b/app/Containers/AppSection/Authentication/UI/API/Requests/SendVerificationEmailRequest.php index e5ced0d40..14340279f 100644 --- a/app/Containers/AppSection/Authentication/UI/API/Requests/SendVerificationEmailRequest.php +++ b/app/Containers/AppSection/Authentication/UI/API/Requests/SendVerificationEmailRequest.php @@ -36,7 +36,11 @@ class SendVerificationEmailRequest extends Request public function rules(): array { return [ - 'verification_url' => 'required|url|' . Rule::in(config('appSection-authentication.allowed-verify-email-urls')), + 'verification_url' => [ + 'required', + 'url', + Rule::in(config('appSection-authentication.allowed-verify-email-urls')), + ], ]; }