PHP code example of ghanem / laravel-smsmisr

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

    

ghanem / laravel-smsmisr example snippets


'providers' => [
    // Other service providers...

    Ghanem\LaravelSmsmisr\SmsmisrServiceProvider::class,
],

'aliases' => [
    ...
    'Smsmisr' => Ghanem\LaravelSmsmisr\Smsmisr::class,
],

use use Ghanem\LaravelSmsmisr\Facades\Smsmisr;
    ...
    public function myMethod() {
        Smsmisr::send("hello world", "201010101010");  
    }

// Global
app('smsmisr')->send("hello world", "201010101010");

namespace App\Notifications;

use Ghanem\LaravelSmsmisr\SmsmisrChannel;
use Ghanem\LaravelSmsmisr\SmsmisrMessage;
use Illuminate\Notifications\Notification;

class ExampleNotification extends Notification
{
    public function via($notifiable)
    {
        return [SmsmisrChannel::class];
    }
    
    public function toSmsmisr($notifiable)
    {
    	return new SmsmisrMessage(
            'Your message here',
    	    $notifiable->phone
        );
    }
}
bash
php artisan vendor:publish --provider="Ghanem\LaravelSmsmisr\SmsmisrServiceProvider"