PHP code example of coreproc / laravel-notification-channel-globe-labs-sms

1. Go to this page and download the library: Download coreproc/laravel-notification-channel-globe-labs-sms 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/ */

    

coreproc / laravel-notification-channel-globe-labs-sms example snippets


'connections' => [
    ....
    'globe_labs_sms' => [
        'short_code' => env('GLOBE_LABS_SMS_SHORT_CODE'),
    ],
    ...
]

class User extends Model
{
    use Notifiable;

    public function routeNotificationForGlobeLabsSms()
    {
        return [
            'access_token' => 'access-token-obtained-from-sms-opt-in-this-could-be-stored-in-your-database',
            'address' => '09171234567', // can be any format as long as it is a valid mobile number
        ];
    }
}

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

    public function toGlobeLabsSms($notifiable) 
    {
        return GlobeLabsSmsMessage::create($notifiable)
            ->setMessage('This is a test message');
    }
}

$user = User::find(1);

$user->notify(new AccountActivated);