From b064593e8e559b4fa89dd4ee385ca878206425d0 Mon Sep 17 00:00:00 2001 From: sanatisharif Date: Thu, 26 Sep 2019 19:42:18 +0330 Subject: [PATCH] mobile verification updated! --- app/Notifications/VerifyMobile.php | 4 ++-- app/Providers/EventServiceProvider.php | 4 ++++ app/Traits/MustVerifyMobileNumberTrait.php | 4 ++-- resources/lang/fa-IR.json | 2 +- resources/lang/fa-IR/messages.php | 2 +- resources/views/welcome.blade.php | 9 +++++---- 6 files changed, 15 insertions(+), 10 deletions(-) diff --git a/app/Notifications/VerifyMobile.php b/app/Notifications/VerifyMobile.php index bf5014b..b3f46db 100644 --- a/app/Notifications/VerifyMobile.php +++ b/app/Notifications/VerifyMobile.php @@ -56,7 +56,7 @@ public function toMediana($notifiable) private function msg(): string { - $messageCore = "کد تایید شماره موبایل شما :"."\n".$this->user->getMobileVerificationCode()."\n"; + $messageCore = 'کد تایید شماره موبایل شما :'."\n".$this->user->getMobileVerificationCode()."\n"; $message = $messageCore; return $message; @@ -74,7 +74,7 @@ private function getInputData(): array /** * @return mixed */ - private function getUserFullName():string + private function getUserFullName():?string { $userFullName = optional($this->user)->full_name; return (isset($userFullName))?$userFullName:'کاربر' ; diff --git a/app/Providers/EventServiceProvider.php b/app/Providers/EventServiceProvider.php index 4cc9028..24e787c 100644 --- a/app/Providers/EventServiceProvider.php +++ b/app/Providers/EventServiceProvider.php @@ -3,6 +3,7 @@ namespace App\Providers; use App\Events\CountOption; +use App\Events\Authenticated; use App\Events\MobileVerificationCodeGenerated; use App\Events\MobileVerified; use App\Listeners\CountOptionListener; @@ -33,6 +34,9 @@ class EventServiceProvider extends ServiceProvider ], MobileVerificationCodeGenerated::class => [ MobileVerificationCodeGeneratedListener::class + ], + Authenticated::class => [ + SendMobileVerificationNotification::class, ] ]; diff --git a/app/Traits/MustVerifyMobileNumberTrait.php b/app/Traits/MustVerifyMobileNumberTrait.php index 395981b..b1e5a51 100644 --- a/app/Traits/MustVerifyMobileNumberTrait.php +++ b/app/Traits/MustVerifyMobileNumberTrait.php @@ -89,9 +89,9 @@ public function sendMobileVerifiedNotification(): void /** * get user's verification code * - * @return string + * @return string|null */ - public function getMobileVerificationCode(): string + public function getMobileVerificationCode(): ?string { return $this->mobile_verified_code; } diff --git a/resources/lang/fa-IR.json b/resources/lang/fa-IR.json index d85b138..2fc8b06 100644 --- a/resources/lang/fa-IR.json +++ b/resources/lang/fa-IR.json @@ -1,5 +1,5 @@ { - "Site Name" : "نظر سنجی کتاب خوب من", + "Site Name" : "سامانه نظر سنجی آی\u200Cنو", "Home" : "خانه", "Register" : "ثبت نام", "Login" : "ورود", diff --git a/resources/lang/fa-IR/messages.php b/resources/lang/fa-IR/messages.php index faa62f6..f5ecc02 100644 --- a/resources/lang/fa-IR/messages.php +++ b/resources/lang/fa-IR/messages.php @@ -7,7 +7,7 @@ 'database_error_delete' => 'خطای پایگاه داده در حذف :resource', 'database_success_update' => ':resource با موفیت اصلاح شد', 'database_error_update' => 'خطای پایگاه داده در اصلاح :resource', - 'user_has_voted_before' => 'شما قبلا برای این سوال رأی داده است', + 'user_has_voted_before' => 'شما قبلا برای این سوال رأی داده‌اید.', 'user_signed_out' => 'کاربر با موفقیت خارج شد', 'user_signed_in' => 'کاربر با موفقیت وارد شد', 'mobile_is_not_verified' => 'شماره موبایل شما تایید نشده است', diff --git a/resources/views/welcome.blade.php b/resources/views/welcome.blade.php index 8413f7c..06a5e9d 100644 --- a/resources/views/welcome.blade.php +++ b/resources/views/welcome.blade.php @@ -8,7 +8,8 @@