PHP code example of jake142 / laravel-service
1. Go to this page and download the library: Download jake142/laravel-service 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/ */
jake142 / laravel-service example snippets
(new GenericQueue('Services\\V1\\Test\\Jobs\\ExampleJob', ['param'=>'test'], $queue = null))->dispatch();
namespace Services\V1\Test\Jobs;
use Jake142\Service\Queue\Jobs\Generic as GenericJob;
/**
* An example job
*/
class ExampleJob extends GenericJob
{
/**
* Execute the job.
*
* @return void
*/
public function handle($payload)
{
try
{
//Your code goes here...
Log::info($payload['param']);
}
catch(\Exception $e)
{
throw $e;
}
}
}
config('laravel-service.<version>.<service>.<config_file>.<value>');