From 3f6a9f0b8a9a36b597e19aff07b8027a8e914624 Mon Sep 17 00:00:00 2001 From: damini-7span Date: Wed, 13 Nov 2024 17:09:25 +0530 Subject: [PATCH] Code structure changes. --- .../Controllers/Api/V1/AuthController.php | 14 ++--- .../Controllers/Api/V1/LanguageController.php | 2 +- .../Api/V1/MasterSettingController.php | 2 +- .../Api/V1/SignedUrlController.php | 4 +- .../Controllers/Api/V1/UserController.php | 4 +- app/Http/Requests/Auth/ResetPasswordOtp.php | 2 +- app/Http/Requests/Auth/VerifyOtp.php | 2 +- app/Jobs/ForgetPasswordOtpMail.php | 1 + app/Jobs/VerifyUserMail.php | 11 ++-- app/Mail/ForgetPassword.php | 2 +- app/Mail/ForgetPasswordOtp.php | 3 +- app/Models/Country.php | 11 +++- app/Models/MasterSetting.php | 13 ++-- app/Models/User.php | 12 ++-- app/Models/UserOtp.php | 15 ++--- app/Services/AuthService.php | 24 ++++---- app/Services/UserOtpService.php | 2 +- app/Services/UserService.php | 8 ++- bootstrap/app.php | 7 ++- config/site.php | 6 +- lang/en/email.php | 6 +- public/assets/css/developer/dashboard.css | 61 +++++++++---------- .../views/developer/pages/dashboard.blade.php | 23 ++++--- .../emails/forget-password-otp.blade.php | 13 ++-- .../views/emails/forget-password.blade.php | 2 +- resources/views/emails/verify-user.blade.php | 16 +++-- 26 files changed, 146 insertions(+), 120 deletions(-) diff --git a/app/Http/Controllers/Api/V1/AuthController.php b/app/Http/Controllers/Api/V1/AuthController.php index 3a25394..25fe5b0 100644 --- a/app/Http/Controllers/Api/V1/AuthController.php +++ b/app/Http/Controllers/Api/V1/AuthController.php @@ -112,7 +112,7 @@ public function __construct() )] public function signUp(SignUpRequest $request): JsonResponse { - $data = $this->authService->signup($request->all()); + $data = $this->authService->signup($request->validated()); return $this->success($data, 200); } @@ -155,7 +155,7 @@ enum: ['verification', 'reset_password', 'update_profile'], )] public function sendOtp(SendOtpRequest $request): JsonResponse { - $data = $this->authService->sendOtp($request->all()); + $data = $this->authService->sendOtp($request->validated()); return $this->success($data, 200); } @@ -203,7 +203,7 @@ public function sendOtp(SendOtpRequest $request): JsonResponse )] public function verifyOtp(VerifyOtpRequest $request): JsonResponse { - $data = $this->authService->verifyOtp($request->all()); + $data = $this->authService->verifyOtp($request->validated()); return $this->success($data, 200); } @@ -248,7 +248,7 @@ public function verifyOtp(VerifyOtpRequest $request): JsonResponse )] public function login(LoginRequest $request) { - $data = $this->authService->login($request->all()); + $data = $this->authService->login($request->validated()); return $this->success($data, 200); } @@ -383,7 +383,7 @@ public function forgetPassword(ForgetPasswordRequest $request): JsonResponse )] public function resetPasswordOtp(ResetPasswordOtpRequest $request): JsonResponse { - $data = $this->authService->resetPasswordOtp($request->all()); + $data = $this->authService->resetPasswordOtp($request->validated()); return $this->success($data, 200); } @@ -445,7 +445,7 @@ public function resetPasswordOtp(ResetPasswordOtpRequest $request): JsonResponse )] public function resetPassword(ResetPasswordRequest $request): JsonResponse { - $data = $this->authService->resetPassword($request->all()); + $data = $this->authService->resetPassword($request->validated()); return $this->success($data, 200); } @@ -502,7 +502,7 @@ public function resetPassword(ResetPasswordRequest $request): JsonResponse )] public function changePassword(ChangePasswordRequest $request): JsonResponse { - $data = $this->authService->changePassword($request->all()); + $data = $this->authService->changePassword($request->validated()); return $this->success($data, 200); } diff --git a/app/Http/Controllers/Api/V1/LanguageController.php b/app/Http/Controllers/Api/V1/LanguageController.php index b3cc8ac..fbca37b 100644 --- a/app/Http/Controllers/Api/V1/LanguageController.php +++ b/app/Http/Controllers/Api/V1/LanguageController.php @@ -88,6 +88,6 @@ public function show(string $language): JsonResponse { $data = $this->langService->resource($language); - return isset($data['errors']) ? $this->error($data) : $this->success($data, 200); + return $this->success($data, 200); } } diff --git a/app/Http/Controllers/Api/V1/MasterSettingController.php b/app/Http/Controllers/Api/V1/MasterSettingController.php index 43a055e..8eb0326 100644 --- a/app/Http/Controllers/Api/V1/MasterSettingController.php +++ b/app/Http/Controllers/Api/V1/MasterSettingController.php @@ -66,7 +66,7 @@ public function index(Request $request) } #[OA\Get( - path: '/api/v1/versions/{masterSetting_id}', + path: '/api/v1/settings/{masterSetting_id}', operationId: 'getVersionDetail', tags: ['MasterSettings'], summary: 'Get detail of settings', diff --git a/app/Http/Controllers/Api/V1/SignedUrlController.php b/app/Http/Controllers/Api/V1/SignedUrlController.php index 29435d8..633b42a 100644 --- a/app/Http/Controllers/Api/V1/SignedUrlController.php +++ b/app/Http/Controllers/Api/V1/SignedUrlController.php @@ -72,8 +72,8 @@ public function __construct() )] public function __invoke(SignedUrlRequest $request) { - $signedUrlObj = $this->signedUrlService->create($request->all()); + $signedUrlObj = $this->signedUrlService->create($request->validated()); - return isset($signedUrlObj['errors']) ? $this->error($signedUrlObj) : $this->success($signedUrlObj, 200); + return $this->success($signedUrlObj, 200); } } diff --git a/app/Http/Controllers/Api/V1/UserController.php b/app/Http/Controllers/Api/V1/UserController.php index 214b46b..79a5eb3 100644 --- a/app/Http/Controllers/Api/V1/UserController.php +++ b/app/Http/Controllers/Api/V1/UserController.php @@ -123,8 +123,8 @@ public function me(): JsonResponse )] public function updateProfile(UpdateProfile $request): JsonResponse { - $data = $this->userService->update(Auth::id(), $request->all()); + $data = $this->userService->update(Auth::id(), $request->validated()); - return isset($data['errors']) ? $this->error($data) : $this->success($data, 200); + return $this->success($data, 200); } } diff --git a/app/Http/Requests/Auth/ResetPasswordOtp.php b/app/Http/Requests/Auth/ResetPasswordOtp.php index 816b9df..f009cdc 100644 --- a/app/Http/Requests/Auth/ResetPasswordOtp.php +++ b/app/Http/Requests/Auth/ResetPasswordOtp.php @@ -24,7 +24,7 @@ public function rules(): array return [ 'email' => 'required|email|max:255', 'password' => 'required|min:8|confirmed', - 'otp' => 'required|digits:' . config('site.generateOtpLength'), + 'otp' => 'required|digits:' . config('site.generate_otp_length'), ]; } } diff --git a/app/Http/Requests/Auth/VerifyOtp.php b/app/Http/Requests/Auth/VerifyOtp.php index 6427e66..6c5f67a 100644 --- a/app/Http/Requests/Auth/VerifyOtp.php +++ b/app/Http/Requests/Auth/VerifyOtp.php @@ -13,7 +13,7 @@ public function authorize(): bool public function rules(): array { - $otpLength = config('site.generateOtpLength'); + $otpLength = config('site.generate_otp_length'); return [ 'email' => 'required|email|max:120', diff --git a/app/Jobs/ForgetPasswordOtpMail.php b/app/Jobs/ForgetPasswordOtpMail.php index 37efb02..d886d25 100644 --- a/app/Jobs/ForgetPasswordOtpMail.php +++ b/app/Jobs/ForgetPasswordOtpMail.php @@ -33,6 +33,7 @@ public function handle(): void 'otp' => $this->otp, 'firstname' => $this->user->first_name, 'lastname' => $this->user->last_name, + 'subject' => __('email.forgetPasswordEmailSubject'), ]; Mail::to($this->user->email)->send(new ForgetPasswordOtp(data: $data)); } catch (\Exception $e) { diff --git a/app/Jobs/VerifyUserMail.php b/app/Jobs/VerifyUserMail.php index b79a833..f2d7406 100644 --- a/app/Jobs/VerifyUserMail.php +++ b/app/Jobs/VerifyUserMail.php @@ -18,20 +18,21 @@ class VerifyUserMail implements ShouldQueue /** * Create a new job instance. */ - public function __construct(private ?object $user, private int|string $otp) {} + public function __construct(private ?object $user, private int|string $otp) + { + } /** * Execute the job. */ public function handle(): void { - Log::info($this->user); - + Log::info($this->user->first_name); try { $data = [ 'otp' => $this->otp, - 'firstname' => $this->user->firstname, - 'lastname' => $this->user->lastname, + 'firstname' => $this->user->first_name, + 'lastname' => $this->user->last_name, 'subject' => __('email.verifyUserSubject'), ]; Mail::to($this->user->email)->send(new VerifyUser($data)); diff --git a/app/Mail/ForgetPassword.php b/app/Mail/ForgetPassword.php index dc93763..a47e822 100644 --- a/app/Mail/ForgetPassword.php +++ b/app/Mail/ForgetPassword.php @@ -21,7 +21,7 @@ class ForgetPassword extends Mailable public function __construct(private ?array $data) { $this->url = url( - config('site.frontWebsiteUrl') . + config('site.front_website_url') . '/reset-password?token=' . $data['reset_password_token'] . '&email=' . diff --git a/app/Mail/ForgetPasswordOtp.php b/app/Mail/ForgetPasswordOtp.php index afb745b..77b71ef 100644 --- a/app/Mail/ForgetPasswordOtp.php +++ b/app/Mail/ForgetPasswordOtp.php @@ -4,6 +4,7 @@ use Illuminate\Bus\Queueable; use Illuminate\Mail\Mailable; +use Illuminate\Support\Facades\Log; use Illuminate\Mail\Mailables\Content; use Illuminate\Queue\SerializesModels; use Illuminate\Mail\Mailables\Envelope; @@ -23,7 +24,7 @@ public function __construct(private ?array $data) public function envelope(): Envelope { return new Envelope( - subject: __('email.forgetPasswordEmailSubject'), + subject: $this->data['subject'], ); } diff --git a/app/Models/Country.php b/app/Models/Country.php index 3d189b4..c355637 100644 --- a/app/Models/Country.php +++ b/app/Models/Country.php @@ -8,7 +8,7 @@ class Country extends Model { - use BaseModel,HasFactory; + use BaseModel, HasFactory; protected $fillable = [ 'iso', @@ -17,4 +17,13 @@ class Country extends Model 'numcode', 'phonecode', ]; + + protected function casts(): array + { + return [ + 'created_at' => 'timestamp', + 'updated_at' => 'timestamp', + 'deleted_at' => 'timestamp', + ]; + } } diff --git a/app/Models/MasterSetting.php b/app/Models/MasterSetting.php index 03a215f..cda0af7 100644 --- a/app/Models/MasterSetting.php +++ b/app/Models/MasterSetting.php @@ -18,11 +18,14 @@ class MasterSetting extends Model 'is_public', // If key is false, visible only for authenticated user. If true, visible for every user. ]; - protected $casts = [ - 'created_at' => 'timestamp', - 'updated_at' => 'timestamp', - 'deleted_at' => 'timestamp', - ]; + protected function casts(): array + { + return [ + 'created_at' => 'timestamp', + 'updated_at' => 'timestamp', + 'deleted_at' => 'timestamp', + ]; + } protected $hidden = ['created_at', 'updated_at', 'deleted_at']; } diff --git a/app/Models/User.php b/app/Models/User.php index ef6c9bd..e4dca4b 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -2,8 +2,6 @@ namespace App\Models; -// use Illuminate\Contracts\Auth\MustVerifyEmail; - use App\Traits\BaseModel; use Laravel\Sanctum\HasApiTokens; use Illuminate\Support\Facades\Hash; @@ -45,7 +43,7 @@ class User extends Authenticatable 'remember_token', ]; - protected $dates = ['created_at']; + // protected $dates = ['created_at']; protected $relationship = []; @@ -60,11 +58,9 @@ protected function casts(): array 'email_verified_at' => 'datetime', 'password' => 'hashed', 'last_login_at' => 'datetime', + 'created_at' => 'timestamp', + 'updated_at' => 'timestamp', + 'deleted_at' => 'timestamp', ]; } - - protected function password(): Attribute - { - return Attribute::set(fn (string $password) => Hash::make($password)); - } } diff --git a/app/Models/UserOtp.php b/app/Models/UserOtp.php index 7c9c9e2..ecd020e 100644 --- a/app/Models/UserOtp.php +++ b/app/Models/UserOtp.php @@ -40,13 +40,14 @@ class UserOtp extends Model ], ]; - protected $cast = [ - 'created_at' => 'timestamp', - ]; - - protected $dates = [ - 'created_at', - ]; + protected function casts(): array + { + return [ + 'created_at' => 'timestamp', + 'updated_at' => 'timestamp', + 'deleted_at' => 'timestamp', + ]; + } /** * Model's relationships diff --git a/app/Services/AuthService.php b/app/Services/AuthService.php index 35876a1..bd4adec 100644 --- a/app/Services/AuthService.php +++ b/app/Services/AuthService.php @@ -37,11 +37,10 @@ public function __construct() public function signup(array $inputs): array { - DB::beginTransaction(); $user = $this->userObj->create($inputs); - $otp = Helper::generateOTP(config('site.generateOtpLength')); + $otp = Helper::generateOTP(config('site.generate_otp_length')); $this->userOtpService->store(['otp' => $otp, 'user_id' => $user->id, 'otp_for' => 'verification']); - DB::commit(); + try { VerifyUserMail::dispatch($user, $otp); } catch (\Exception $e) { @@ -59,13 +58,13 @@ public function signup(array $inputs): array public function sendOtp(array $inputs): array { - $user = $this->userObj->whereEmail($inputs['email'])->first(); + $user = $this->userObj->where('email', $inputs['email'])->first(); if (empty($user)) { throw new CustomException(__('message.emailNotExist')); } - $otp = Helper::generateOTP(config('site.generateOtpLength')); + $otp = Helper::generateOTP(config('site.generate_otp_length')); switch ($inputs['otp_for']) { case 'verification': @@ -99,7 +98,7 @@ public function sendOtp(array $inputs): array public function verifyOtp(array $inputs): array { - $user = $this->userObj->whereEmail($inputs['email'])->first(); + $user = $this->userObj->where('email', $inputs['email'])->first(); if (empty($user)) { throw new CustomException(__('message.emailNotExist')); @@ -117,7 +116,7 @@ public function verifyOtp(array $inputs): array } $this->userOtpService->update($userOtp['id'], ['verified_at' => date('Y-m-d h:i:s')]); - $this->userObj->whereId($user['id'])->update(['email_verified_at' => date('Y-m-d h:i:s')]); + $this->userObj->where('id', $user['id'])->update(['email_verified_at' => date('Y-m-d h:i:s')]); $data = [ 'message' => __('message.userVerifySuccess'), @@ -128,7 +127,7 @@ public function verifyOtp(array $inputs): array public function login(array $inputs): array { - $user = $this->userObj->whereEmail($inputs['email'])->first(); + $user = $this->userObj->where('email', $inputs['email'])->first(); if (!$user || !Hash::check($inputs['password'], $user->password)) { throw new CustomException(__('auth.failed')); @@ -151,14 +150,14 @@ public function login(array $inputs): array public function forgetPasswordOtp(array $inputs): array { - $user = $this->userObj->whereEmail($inputs['email'])->first(); + $user = $this->userObj->where('email', $inputs['email'])->first(); if (empty($user)) { throw new CustomException(__('message.emailNotExist')); } - $this->userOtpObj->whereUserId($user['id'])->where('otp_for', 'reset_password')->delete(); + $this->userOtpObj->where('user_id', $user['id'])->where('otp_for', 'reset_password')->delete(); - $otp = Helper::generateOTP(config('site.generateOtpLength')); + $otp = Helper::generateOTP(config('site.generate_otp_length')); $this->userOtpService->store(['otp' => $otp, 'user_id' => $user->id, 'otp_for' => 'reset_password']); try { @@ -192,7 +191,7 @@ public function forgetPassword(array $inputs): array public function resetPasswordOtp(array $inputs): array { - $user = $this->userObj->whereEmail($inputs['email'])->first(); + $user = $this->userObj->where('email', $inputs['email'])->first(); if (empty($user)) { throw new CustomException(__('message.emailNotExist')); @@ -227,7 +226,6 @@ public function resetPassword(array $inputs): array 'token' => $inputs['token'], 'email' => $inputs['email'], 'password' => $inputs['password'], - 'password_confirmation' => $inputs['password_confirmation'], ], function (User $user, string $password) { $user->forceFill([ 'password' => $password, diff --git a/app/Services/UserOtpService.php b/app/Services/UserOtpService.php index 0c68f27..cf95597 100644 --- a/app/Services/UserOtpService.php +++ b/app/Services/UserOtpService.php @@ -38,7 +38,7 @@ public function update(int $id, array $inputs): bool public function isOtpExpired(int|string $createdAt, int|string|null $verifiedAt): string { - $expirationTime = config('site.otpExpirationTimeInMinutes'); + $expirationTime = config('site.otp_expiration_time_in_minutes'); $expirationDate = Carbon::parse($createdAt)->addMinutes($expirationTime)->format('Y-m-d H:i:s'); diff --git a/app/Services/UserService.php b/app/Services/UserService.php index dc6ae1a..3747732 100644 --- a/app/Services/UserService.php +++ b/app/Services/UserService.php @@ -7,6 +7,7 @@ use App\Jobs\VerifyUserMail; use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Auth; +use App\Http\Resources\User\Resource; class UserService { @@ -34,7 +35,7 @@ public function update(int $id, array $inputs = []): array if (!empty($inputs['email']) && $inputs['email'] != $user->email) { $inputs['email_verified_at'] = null; - $otp = Helper::generateOTP(config('site.generateOtpLength')); + $otp = Helper::generateOTP(config('site.generate_otp_length')); $this->userOtpService->store(['otp' => $otp, 'user_id' => $user->id, 'otp_for' => 'verification']); try { @@ -46,13 +47,13 @@ public function update(int $id, array $inputs = []): array $user->update($inputs); $data = [ 'message' => __('message.updateUserVerifySuccess'), - 'data' => $user->refresh(), + 'user' => new Resource($user), ]; } else { $user->update($inputs); $data = [ 'message' => __('message.userProfileUpdate'), - 'data' => $user->refresh(), + 'user' => new Resource($user), ]; } @@ -64,6 +65,7 @@ public function changeStatus(object $user, array $inputs = []) $user->update($inputs); $data = [ 'message' => __('entity.entityUpdated', ['entity' => 'User status']), + 'user' => new Resource($user), ]; return $data; diff --git a/bootstrap/app.php b/bootstrap/app.php index 14e8719..3596f5f 100644 --- a/bootstrap/app.php +++ b/bootstrap/app.php @@ -35,5 +35,10 @@ ]); }) ->withExceptions(function (Exceptions $exceptions) { - $exceptions->renderable(fn (NotFoundHttpException $e, Request $request) => ExceptionHelper::notFoundHandler($e, $request)); + $exceptions->render(function (NotFoundHttpException $e) { + $message = $e->getMessage(); + return response()->json([ + 'message' => $message + ], 404); + }); })->create(); diff --git a/config/site.php b/config/site.php index ee54535..fb4300e 100644 --- a/config/site.php +++ b/config/site.php @@ -1,9 +1,9 @@ 10, - 'generateOtpLength' => '6', - 'frontWebsiteUrl' => env('FRONT_WEBSITE_URL', 'http://127.0.0.1:8000'), + 'otp_expiration_time_in_minutes' => 10, + 'generate_otp_length' => '6', + 'front_website_url' => env('FRONT_WEBSITE_URL', 'http://127.0.0.1:8000'), 'pagination' => [ 'limit' => 10, ], diff --git a/lang/en/email.php b/lang/en/email.php index 4e7e729..865d422 100644 --- a/lang/en/email.php +++ b/lang/en/email.php @@ -1,7 +1,7 @@ 'Hello', + 'hello' => 'Hello,', 'thanks' => 'Thanks', 'forgetPasswordEmailSubject' => 'Forgot Password', 'forgetPasswordEmailLine1' => 'You requested to reset your password, please use the below code to reset your password.', @@ -18,5 +18,7 @@ 'forgetPasswordLinkEmailLine2' => 'To reset your password, please click on the following link:', 'link' => 'Password Reset Link', 'forgetPasswordOtpEmailLine1' => 'Use the following OTP to complete your Reset Password procedures. OTP is valid for 10 minutes.', - 'regards' => 'regards,' + 'regards' => 'Regards,', + 'verifyUserLine1' => 'Thank you for choosing ' . config('app.name') . '. Use the following OTP to complete your + :subject process. OTP is valid for :expirationTime minutes.' ]; diff --git a/public/assets/css/developer/dashboard.css b/public/assets/css/developer/dashboard.css index 78c01b0..14a5448 100644 --- a/public/assets/css/developer/dashboard.css +++ b/public/assets/css/developer/dashboard.css @@ -84,20 +84,10 @@ a { text-decoration: none; } -.log-viewer .block { - display: block; - border-radius: 0.5rem; - box-shadow: 0 4px 6px -1px rgba(9, 9, 16, 0.1), - 0 2px 4px -1px rgba(9, 9, 16, 0.06); - max-width: 20rem; - text-align: center; - background-color: #2563eb; - height: 100%; -} - .log-viewer .block h5, .telescope .block h5, -.scramble .block h5, +.swagger .block h5, +.pulse .block h5, .horizon .block h5 { color: white; font-size: 1.6rem; @@ -108,7 +98,8 @@ a { .log-viewer .block p, .telescope .block p, -.scramble .block p, +.swagger .block p, +.pulse .block p, .horizon .block p { color: white; font-size: 1rem; @@ -117,32 +108,40 @@ a { font-family: serif; } -.telescope .block { - display: block; - border-radius: 0.5rem; - box-shadow: 0 4px 6px -1px rgba(9, 9, 16, 0.1), - 0 2px 4px -1px rgba(9, 9, 16, 0.06); - background-color: #7c3aed; - max-width: 20rem; - text-align: center; +.grid-container { + display: grid; + grid-template-columns: repeat(4, 1fr); /* Creates 4 equal columns */ + gap: 12px; + margin-top: 20px; } -.scramble .block { +.block { display: block; border-radius: 0.5rem; box-shadow: 0 4px 6px -1px rgba(9, 9, 16, 0.1), 0 2px 4px -1px rgba(9, 9, 16, 0.06); - background-color: #eb70eb; - max-width: 20rem; text-align: center; + height: 220px; +} + + + +.telescope .block { + background-color: #7c3aed; } .horizon .block { - display: block; - border-radius: 0.5rem; - box-shadow: 0 4px 6px -1px rgba(9, 9, 16, 0.1), - 0 2px 4px -1px rgba(9, 9, 16, 0.06); - background-color: #374151; - max-width: 20rem; - text-align: center; + background-color: #b05470; +} + +.log-viewer .block { + background-color: #2563eb; +} + +.swagger .block { + background-color: #12c03a; +} + +.pulse .block { + background-color: #eb70eb; } diff --git a/resources/views/developer/pages/dashboard.blade.php b/resources/views/developer/pages/dashboard.blade.php index 04ce8cc..fefc764 100644 --- a/resources/views/developer/pages/dashboard.blade.php +++ b/resources/views/developer/pages/dashboard.blade.php @@ -24,15 +24,16 @@
-
-
+
+
-
+
-
+
- -
+ -
-
+ -

Hi {{ $data['firstname'] }} {{ $data['lastname'] }},

+

+ {{ __('email.hello') }} {{ $data['firstname'] }} {{ $data['lastname'] }} +

-

Thank you for choosing {{ config('app.name') }}. Use the following OTP to complete your Reset Password - procedures. OTP is valid for 10 minutes.

+

{{ __('email.verifyUserLine1', [ + 'subject' => $data['subject'], + 'expirationTime' => config('site.otp_expiration_time_in_minutes'), + ]) }} +

{{ $data['otp'] }}

-

Regards,
{{ config('app.name') }}

+

{{ __('email.regards') }}
{{ config('app.name') }}

diff --git a/resources/views/emails/forget-password.blade.php b/resources/views/emails/forget-password.blade.php index 866b3d6..54f5cfd 100644 --- a/resources/views/emails/forget-password.blade.php +++ b/resources/views/emails/forget-password.blade.php @@ -15,7 +15,7 @@ style="font-size:1.4em;color: #00466a;text-decoration:none;font-weight:600">{{ config('app.name') }}

{{ __('email.hello') }} {{ $data['firstname'] }} - {{ $data['lastname'] }},

+ {{ $data['lastname'] }}

{{ __('email.forgetPasswordLinkEmailLine1') }}

diff --git a/resources/views/emails/verify-user.blade.php b/resources/views/emails/verify-user.blade.php index 72631a4..12e092a 100644 --- a/resources/views/emails/verify-user.blade.php +++ b/resources/views/emails/verify-user.blade.php @@ -14,16 +14,20 @@ {{ config('app.name') }}
-

Hi {{ $data['firstname'] }} {{ $data['lastname'] }},

-

Thank you for choosing {{ config('app.name') }}. Use the following OTP to complete your - {{ $data['subject'] }} process. - OTP is valid for 10 minutes.

+

+ {{ __('email.hello') }} {{ $data['firstname'] }} {{ $data['lastname'] }}

+ +

+ {{ __('email.verifyUserLine1', [ + 'subject' => $data['subject'], + 'expirationTime' => config('site.otp_expiration_time_in_minutes'), + ]) }} +

{{ $data['otp'] }}

- -

Regards,
{{ config('app.name') }}

+

{{ __('email.regards') }}
{{ config('app.name') }}