PHP code example of foolkaka / laravel-notification-dayu
1. Go to this page and download the library: Download foolkaka/laravel-notification-dayu 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/ */
foolkaka / laravel-notification-dayu example snippets
public function routeNotificationForDayusms()
{
// where `phone` is a field in your users table;
// can set multiple phones as string which separated by comma `,` .
return $this->phone;
}
php
use NotificationChannels\Dayusms\DayusmsChannel;
use NotificationChannels\Dayusms\DayusmsMessage;
use Illuminate\Notifications\Notification;
class ValentineDateApproved extends Notification
{
public function via($notifiable)
{
return [DayusmsChannel::class];
}
public function toDayusms($notifiable)
{
return (new DayusmsMessage())
->content('{"level":"P0", "service":"'.$notifiable->service.'", "info":"502"}');
}
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.