PHP code example of sideso / hablame

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

    

sideso / hablame example snippets


// config/hablame.php
...
'hablame' => [
	'account' => env('HABLAME_ACCOUNT',''),
	'api_key' => env('HABLAME_API_KEY',''),
	'token' => env('HABLAME_TOKEN'.''),
	'source_code' => env('HABLAME_SOURCE_CODE',''),
],
...

use Illuminate\Notifications\Notification;
use NotificationChannels\hablame\HablameMessage;

class AccountApproved extends Notification
{
    public function via($notifiable)
    {
        return ["hablame"];
    }

    public function tohablame($notifiable)
    {
        return (new HablameMessage)->content("Your account was approved!");       
    }
}

public function routeNotificationForhablame()
{
    return $this->phone;
}

Notification::route('hablame', '573001234567')                      
            ->notify(new InvoicePaid($invoice));

use Sideso\Hablame\HablameChannel;
use Sideso\Hablame\Hablame;

$bulk = [
	[
		'numero' => '3000000001',
		'sms' => 'Hello World!',
	],
	[
		'numero' => '3000000002',
		'sms' => 'Hello World! (again)',
	],
;

$sms = new HablameChannel(app(Hablame::class));
$sms->bulkSend($bulk);


callBackFunction($notifiable, \Illuminate\Notifications\Notification $notification, \Sideso\SMS\Message $message){
	//Do something
}

$message->withCallback('callBackFunction');
bash
php artisan vendor:publish --provider="Sideso\Hablame\HablameServiceProvider" --tag="config"