PHP code example of unaspbr / laravel-octopus

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

    

unaspbr / laravel-octopus example snippets


unaspbr\OctopusServiceProvider::class,

'Octopus' => unaspbr\Octopus::class,
 
 php artisan vendor:publish
 



use unaspbr\Octopus;

$result = Octopus::queue('nome_da_action', [
	'param1' => 'valor',
	'param2' => 'valor',
]);

var_dump($result);



use unaspbr\Octopus;

$result = Octopus::send([
	[
		'name' => 'nome_da_action',
		'params' => [
			'param1' => 'valor',
			'param2' => 'valor',
		],
	],
	[
		'name' => 'nome_da_outra_action',
		'params' => [
			'param3' => 'valor',
			'param4' => 'valor',
		],
	],
]);

var_dump($result);