PHP code example of 64robots / laravelthinq

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

    

64robots / laravelthinq example snippets




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

}


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

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

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