PHP code example of canerdogan / aws-laravel-notification
1. Go to this page and download the library: Download canerdogan/aws-laravel-notification 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/ */
canerdogan / aws-laravel-notification example snippets
// config/services.php
...
'awssms' => [
'key' => env('AWSSMS_KEY'),
'secret' => env('AWSSMS_SECRET'),
'region' => env('AWSSMS_REGION'),
'from' => env('AWSSMS_FROM'), // optional
'max_price_usd' => '0.50' // Max price, sms wont send if price of the sms is more then this.
],
...
public function routeNotificationForAws()
{
return '+1234567890';
}
php
use NotificationChannels\AWS\AWSSMSChannel;
use NotificationChannels\AWS\AWSSMSMessage;
use Illuminate\Notifications\Notification;
class AccountApproved extends Notification
{
public function via($notifiable)
{
return [AWSSMSChannel::class];
}
public function toAwsSms($notifiable)
{
return (new AWSSMSMessage())
->content("Your {$notifiable->service} account was approved!");
}
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.