PHP code example of lucasgiovanny / laravel-notification-smsdev
1. Go to this page and download the library: Download lucasgiovanny/laravel-notification-smsdev 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/ */
lucasgiovanny / laravel-notification-smsdev example snippets
// config/services.php
...
'smsdev' => [
'api_key' => env('SMSDEV_API_KEY')
],
...
public function routeNotificationFor()
{
return $this->phone_number; //replace with the phone number field you have in your model
}
namespace App\Notifications;
use Illuminate\Notifications\Notification;
use lucasgiovanny\SmsDev\SmsDevChannel;
use lucasgiovanny\SmsDev\SmsDevMessage;
class InvoicePaid extends Notification
{
public function via($notifiable)
{
return [SmsDevChannel::class];
}
public function toSmsdev() {
return (new SmsDevMessage('Invoice paid!'));
}
}