PHP code example of clevel / netgsm-notification-channel

1. Go to this page and download the library: Download clevel/netgsm-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/ */

    

clevel / netgsm-notification-channel example snippets




namespace App\Notifications;

use Illuminate\Notifications\Notification;
use NotificationChannels\Netgsm\NetgsmChannel;
use NotificationChannels\Netgsm\NetgsmMessage;

class InvoicePaid extends Notification
{
    public function via($notifiable)
    {
        return [NetgsmChannel::class];
    }

    public function toNetgsm() {
        return (NetgsmMessage::create('Hallo!'))
        ->from('Max');
    }
}

class User extends Authenticatable
{
    use Notifiable;

    ....

    /**
     * Specifies the user's Phone Number
     *
     * @return string
     */
    public function routeNotificationForNetgsm()
    {
        return $this->phone_number;
    }
}