PHP code example of jlorente / laravel-connectus

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

    

jlorente / laravel-connectus example snippets


return [
    //other stuff
    'providers' => [
        //other stuff
        \Jlorente\Laravel\Connectus\ConnectusServiceProvider::class,
    ];
];

return [
    //other stuff
    'aliases' => [
        //other stuff
        'Connectus' => \Jlorente\Laravel\Connectus\Facades\Connectus::class,
    ];
];

return [
    'api_key' => 'YOUR_API_KEY',
    'account_id' => 'YOUR_ACCOUNT_ID',
    //other configuration
];

Connectus::api()->checkSmsBalance();

/**
 * Get the SMS message.
 *
 * @param  mixed  $notifiable
 * @return string
 */
public function toConnectusSms($notifiable)
{
    return 'Hello, this is an SMS sent through Connectus API';
}

/**
 * Get the notification channels.
 *
 * @param  mixed  $notifiable
 * @return array|string
 */
public function via($notifiable)
{
    return [ConnectusSmsChannel::class];
}



namespace App;

use Illuminate\Notifications\Notifiable;
use Illuminate\Foundation\Auth\User as Authenticatable;

class User extends Authenticatable
{
    use Notifiable;

    /**
     * Route notifications for the Connectus SMS channel.
     *
     * @param  \Illuminate\Notifications\Notification  $notification
     * @return string
     */
    public function routeNotificationForConnectusSms($notification)
    {
        return $this->phone;
    }
}
bash
$ php composer.phar 
bash
$ php artisan vendor:publish --provider='Jlorente\Laravel\Connectus\ConnectusServiceProvider'