PHP code example of aankhijhyaal / laravel-sparrow

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

    

aankhijhyaal / laravel-sparrow example snippets


php artisan vendor:publish --tag=laravel-sparrow

// config/sparrow.php
'url' => <endpoint of sparrow sms API>,
'token' => <token generated from sparrow sms website>,
'identity'=><provided by sparrow sms>

use Aankhijhyaal\LaraSparrow\SmsMessage;
use Illuminate\Notifications\Notification;

class InvoicePaid extends Notification
{
    public function via($notifiable)
    {
        return ['sparrow'];
    }

    public function toSparrow($notifiable)
    {
        return (new SmsMessage())
                ->setContent("Your message.")
                ->setRecipient($notifiable->phone);
    }
}