2017 © Pedro Peláez
 

library sender

Sender - Laravel Provider for SMS-assistent.by

image

jurager/sender

Sender - Laravel Provider for SMS-assistent.by

  • Saturday, March 4, 2017
  • by Jurager
  • Repository
  • 1 Watchers
  • 1 Stars
  • 23 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 5 % Grown

The README.md

Jurager/Sender

Latest Stable Version Total Downloads PHP Version Require License, (*1)

Sender - Laravel Provider for SMS-assistent.by, (*2)

Installation

``` 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"

Usage

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));
}

License

This package is open-sourced software licensed under the MIT license., (*7)

The Versions

04/03 2017

dev-master

9999999-dev https://github.com/jurager/sender

Sender - Laravel Provider for SMS-assistent.by

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

by Gerassimov Yuri

morphy