dev-master
9999999-dev https://github.com/jurager/senderSender - Laravel Provider for SMS-assistent.by
MIT
The Requires
- php >=5.3.0
by Gerassimov Yuri
morphy
Wallogit.com
2017 © Pedro Peláez
Sender - Laravel Provider for SMS-assistent.by
Sender - Laravel Provider for SMS-assistent.by, (*2)
``` bash $ composer require jurager/sender, (*3)
Add to config/app.php in section ```aliases```: ``` php 'Sender' => Jurager\Sender\Sender::class,
Publish package files by running, (*4)
php artisan vendor:publish --provider="Jurager\Sender\SenderServiceProvider"
Now, if you have configured Queues, you can create a Job like this below in /App/Http/Jobs, (*5)
<?php
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);
}
}
And after dispatch a new Job anywhere in your app, (*6)
<?php
use App\Jobs\SMS;
class SampleController
{
$this->dispatch((new SMS( '+71234567890', 'Hello world!')))->delay(5));
}
This package is open-sourced software licensed under the MIT license., (*7)
Sender - Laravel Provider for SMS-assistent.by
MIT
morphy