add rahyab notification service

This commit is contained in:
ehsan.moradi
2025-05-01 17:18:14 +03:30
parent 6d108e43c9
commit b573d1bbed
19 changed files with 1112 additions and 2 deletions
+9 -2
View File
@@ -4,10 +4,11 @@ namespace Packages\Auth;
use App\Http\Controllers\Api\Auth\LoginController;
use App\Models\User;
use App\Services\Notification\SmsNotification;
use Carbon\Carbon;
use Illuminate\Http\Request;
use Packages\Messaging\src\Facades\MessageResponse;
use Packages\SMSSender\SMSSender;
// use Packages\SMSSender\SMSSender;
trait SendsPasswordResetEmails
{
@@ -61,7 +62,13 @@ trait SendsPasswordResetEmails
if ($user) {
$code = rand(100000, 999999);
\Cache::put($code, $user->id, Carbon::now()->addMinutes(30));
SMSSender::instance()->patternSend($request->cell_number, 'jqomyn42wo', ["verification-code" => $code]);
SmsNotification::to( $user )->isSystematic()->send(
trans( 'sms.reset_password' , [
'activation_code' => $code
] ) ,
'service'
);
// SMSSender::instance()->patternSend($request->cell_number, 'jqomyn42wo', ["verification-code" => $code]);
return MessageResponse::success('Send Disposable Password');
}
return MessageResponse::error('User Not Found');