PHP code example of jurager / sender

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

    

jurager / sender example snippets

 php
'Sender' => Jurager\Sender\Sender::class,

php artisan vendor:publish --provider="Jurager\Sender\SenderServiceProvider"



namespace App\Jobs;

use Jurager\Sender\Sender;
use Illuminate\Queue\SerializesModels;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;

class SMS extends Job implements ShouldQueue
{
    use InteractsWithQueue, SerializesModels;

    protected $to;
    protected $text;

    /**
     * @param $to
     * @param $text
     */
    public function __construct($to, $text)
    {
        $this->to   = $to;
        $this->text = $text;
    }

    public function handle(Sender $sender)
    {
        $sender->sendOne($this->to, $this->text);
    }
}



use App\Jobs\SMS;

class SampleController
{
    $this->dispatch((new SMS( '+71234567890', 'Hello world!')))->delay(5));
}