PHP code example of granada-pride / unifonic-sms

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

    

granada-pride / unifonic-sms example snippets


return [
    'appsId' => env('UNIFONIC_APP_SID', 'your-app-sid'),
    'senderId' => env('UNIFONIC_SENDER_ID', 'your-sender-id'),
    'endpoint' => env('UNIFONIC_ENDPOINT', 'https://el.cloud.unifonic.com/rest/SMS/messages'),
];

'channels' => [
    // Other log channels...

    'unifonic' => [
        'driver' => 'single',
        'path' => storage_path('logs/unifonic.log'),
        'level' => 'error',
    ],
],

use GranadaPride\UnifonicSms\Notifications\UnifonicSmsNotification;

$phone = '1234567890';
$message = "Your verification code is 123456";

$user->notify(new UnifonicSmsNotification($phone, $message));

use GranadaPride\UnifonicSms\Notifications\UnifonicSmsNotification;

class CustomSmsNotification extends UnifonicSmsNotification
{
    public function toSms($notifiable)
    {
        return [
            'phone' => $this->phone,
            'message' => "Your custom message",
        ];
    }
}

// Sending the custom SMS
$user->notify(new CustomSmsNotification($phone, $message));
bash
php artisan vendor:publish --provider="GranadaPride\UnifonicSms\UnifonicSmsServiceProvider"