PHP code example of sashalenz / turbosms-notification-channel

1. Go to this page and download the library: Download sashalenz/turbosms-notification-channel 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/ */

    

sashalenz / turbosms-notification-channel example snippets


use Illuminate\Notifications\Notification;
use Sashalenz\TurboSms\TurboSmsChannel;
use Sashalenz\TurboSms\TurboSmsMessage;

class OrderShipped extends Notification
{
    public function via(object $notifiable): array
    {
        return [TurboSmsChannel::class];
    }

    public function toTurboSms(object $notifiable): TurboSmsMessage
    {
        return new TurboSmsMessage("Your order #{$notifiable->id} has shipped.");
    }
}

class User extends Authenticatable
{
    use Notifiable;

    public function routeNotificationForTurbosms(): string
    {
        return $this->phone; // '+380501234567' → '380501234567' on the wire
    }
}

$user->notify(new OrderShipped($order));
bash
php artisan vendor:publish --tag="turbosms-config"