64robots/laravelthinq

:description

Downloads

598

Stars

1

Version

v0.0.8

LaravelThinq

Latest Version on Packagist Total Downloads Build Status StyleCI

This is where your description should go. Take a look at contributing.md to see a to do list.

Installation

Via Composer

$ composer require 64robots/laravelthinq

Usage

php artisan vendor:publish --provider="R64\LaravelThinq\LaravelThinqServiceProvider"

Add this to .env

THINQ_ACCOUNT_ID=Your thinq account id
THINQ_API_KEY=Your thinq api key

Use as notification

<?php

namespace App\Notifications;

use Illuminate\Bus\Queueable;
use Illuminate\Notifications\Notification;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;
use R64\LaravelThinq\ThinqChannel;
use R64\LaravelThinq\ThinqMessage;

class TestThinq extends Notification
{
    use Queueable;

    public $silent = true; //if silent true, the service does not throw error

    /**
     * Create a new notification instance.
     *
     * @return void
     */
    public function __construct()
    {
        //
    }

    /**
     * Get the notification's delivery channels.
     *
     * @param  mixed  $notifiable
     * @return array
     */
    public function via($notifiable)
    {
        return [ThinqChannel::class];
    }

    public function toThinq($notifiable)
    {
        return new ThinqMessage('Send test sms', '122233333', '133333333');
    }

}

Use standalone

$message = new ThinqMessage('Send test sms', '122233333', '133333333');

new Thinq()
    ->setMessage($message)
    ->sendSms() //throws error
    ->sendSilentSms() //does not throw error

Change log

Please see the changelog for more information on what has changed recently.

Testing

$ composer test

Contributing

Please see contributing.md for details and a todolist.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

License

MIT. Please see the license file for more information.

64robots

Author

64robots