PHP code example of maqe / laravel-sqs-fifo

1. Go to this page and download the library: Download maqe/laravel-sqs-fifo 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/ */

    

maqe / laravel-sqs-fifo example snippets


'providers' => [
    Maqe\LaravelSqsFifo\LaravelSqsFifoServiceProvider::class,
],

'connections' => [

    ...

    'my_sqs_fifo' => [
        'driver' => 'sqsfifo',
        'key'    => env('AWS_ACCESS_KEY_ID'),
        'secret' => env('AWS_SECRET_ACCESS_KEY'),
        'queue'  => env('AWS_SQS_URL'),
        'region' => env('AWS_SQS_REGION'),
    ],
],

    'default' => 'my_sqs_fifo',

Queue::connection('my_sqs_fifo')->pushOn('my_queue_name', new MyQueueJob); // Laravel 5.1

(new MyQueueJob)->onConnection('my_sqs_fifo'); // Laravel 5.2+
bash
php artisan queue:listen connection
php artisan queue:work connection