PHP code example of bitarun / laravel-notification-service
1. Go to this page and download the library: Download bitarun/laravel-notification-service library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
bitarun / laravel-notification-service example snippets
use Bitarun\LaravelNotificationService\Facades\Notification;
Notification::sendEmail($user->email, new \App\Mail\WelcomeMail);
use Bitarun\LaravelNotificationService\Facades\Notification;
Notification::sendSms($user->phone_number, 'کد تایید شما: ۱۲۳۴۵');
use Bitarun\LaravelNotificationService\DTOs\NotificationRecipient;
use Bitarun\LaravelNotificationService\Facades\Notification;
$recipient = new NotificationRecipient(
email: $user->email,
name: $user->name
);
Notification::sendEmail($recipient, new \App\Mail\WelcomeMail);
Notification::queue()->sendEmail($user->email, new \App\Mail\WelcomeMail);
use Bitarun\LaravelNotificationService\Facades\Notification;
Notification::sendEmail($user->email, new \App\Mail\WelcomeMail);
use Bitarun\LaravelNotificationService\Facades\Notification;
Notification::sendSms($user->phone_number, 'Your verification code: 12345');
use Bitarun\LaravelNotificationService\DTOs\NotificationRecipient;
use Bitarun\LaravelNotificationService\Facades\Notification;
$recipient = new NotificationRecipient(
email: $user->email,
name: $user->name
);
Notification::sendEmail($recipient, new \App\Mail\WelcomeMail);
Notification::queue()->sendEmail($user->email, new \App\Mail\WelcomeMail);
Notification::now()->sendSms($user->phone_number, 'This message is sent immediately');
Notification::sendEmail($user->email, new \App\Mail\WelcomeMail);