PHP code example of gustavorglima / laravel-json-sqs

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

    

gustavorglima / laravel-json-sqs example snippets


'providers' => [
    ...
    GustavoLima\JsonSQS\LaravelServiceProvider::class,
];

php artisan vendor:publish --provider="GustavoLima\JsonSQS\LaravelServiceProvider"

'json-sqs' => [
    'driver' => 'json-sqs',
    'key' => env('SQS_KEY'),
    'secret' => env('SQS_SECRET'),
    'prefix' => env('SQS_PREFIX'),
    'queue' => env('SQS_QUEUE'),
    'region' => env('SQS_REGION'),
],

public function handle(Job $job, $data)
{
    dd($data); // Just to debug received message
}

'test-job' => App\Jobs\TestJob::class,

dispatch(
    new Dispatcher('test-job', [
        'some' => 'data'
    ])
);

php artisan queue:failed-table

php artisan make:job TestJob

php artisan queue:work json-sqs --tries=3