PHP code example of edriving-limited / dynamic-sqs

1. Go to this page and download the library: Download edriving-limited/dynamic-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/ */

    

edriving-limited / dynamic-sqs example snippets


use App\Jobs\SendWelcomeEmail;
use eDriving\DynamicSqs\JobHandlerContract;
use Illuminate\Contracts\Queue\ShouldQueue;

class SendWelcomeEmailHandler implements JobHandlerContract
{
    public function handle(array $payload): ShouldQueue
    {
        return SendWelcomeEmail($payload['data']['userId']);    
    }
}

[
    'discoverer' => [\eDriving\DynamicSqs\Commands\DiscovererHandler::class, 'discover'],
]

[
    'map' => [
        'sendWelcomeEmail' => SendWelcomeEmailHandler::class 
    ]
]