PHP code example of laraketai / mobizon

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

    

laraketai / mobizon example snippets


// config/app.php
'providers' => [
    ...
    Laraketai\Mobizon\MobizonServiceProvider::class,
],

// config/mobizon.php
...
'mobizon' => [
    'alphaname' => null, //Optional, if you don't have registered alphaname, just skip this param and your message will be sent with our free common alphaname.
    'secret' => env('MOBIZON_APP_KEY'), // Your secret API key
],

use Illuminate\Notifications\Notification;
use Laraketai\Mobizon\MobizonChannel;
use Laraketai\Mobizon\MobizonMessage;

public function via($notifiable)
{
    return [MobizonChannel::class];
}

public function toMobizon($notifiable)
{
    return MobizonMessage::create("Task #{$notifiable->id} is complete!");
}

public function routeNotificationForMobizon()
{
    //Phone Number without symbols or spaces
    return $this->phone_number;
}

php artisan vendor:publish --provider="Laraketai\Mobizon\MobizonServiceProvider"