REDROOM
PHP 8.2.30
Path:
Logout
Edit File
Size: 2.49 KB
Close
/home/byroehnu/easetack.com/app/Repositories/Auth/UserRepository.php
Text
Base64
<?php namespace App\Repositories\Auth; use App\Mail\SendAccountVerificationMail; use App\Models\Setting; use App\Models\User; use App\Repositories\Admin\SmsGatewayRepository; use App\Repositories\Traits\ModelRepositoryTraits; use Illuminate\Support\Facades\Mail; class UserRepository { use ModelRepositoryTraits; protected $model; public function __construct(User $user) { $this->model = $user; } public function sendOtp(User $user) { $verify_method = Setting::pull('authentication_verification_method'); $replacements = [ '{{otp}}' => $user->otp, '{{user_name}}' => $user->name, '{{user_email}}' => $user->email, '{{user_phone}}' => $user->phone, ]; if ($verify_method == 'email') { $subject = Setting::pull('verify_mail_subject'); $body = Setting::pull('verify_mail_body'); $bodyWithValues = str_replace(array_keys($replacements), array_values($replacements), $body); Mail::to($user->email)->send(new SendAccountVerificationMail($bodyWithValues, $subject)); } else { $body = Setting::pull('verify_message'); $bodyWithValues = str_replace(array_keys($replacements), array_values($replacements), $body); $SmsGatewayRepository = app(SmsGatewayRepository::class); $SmsGatewayRepository->sendMessage($user->phone, $bodyWithValues); } } public function sendForgotOtp(User $user) { $verify_method = Setting::pull('authentication_verification_method'); $replacements = [ '{{otp}}' => $user->otp, '{{user_name}}' => $user->name, '{{user_email}}' => $user->email, '{{user_phone}}' => $user->phone, ]; if ($verify_method == 'email') { $subject = Setting::pull('reset_password_mail_subject'); $body = Setting::pull('reset_password_mail_body'); $bodyWithValues = str_replace(array_keys($replacements), array_values($replacements), $body); Mail::to($user->email)->send(new SendAccountVerificationMail($bodyWithValues, $subject)); } else { $body = Setting::pull('reset_password_message'); $bodyWithValues = str_replace(array_keys($replacements), array_values($replacements), $body); $SmsGatewayRepository = app(SmsGatewayRepository::class); $SmsGatewayRepository->sendMessage($user->phone, $bodyWithValues); } } }
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 0 × Files: 1
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
UserRepository.php
2.49 KB
lrw-rw-rw-
2025-04-19 04:22:16
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).