1. Go to this page and download the library: Download spiral/roadrunner-laravel 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/ */
spiral / roadrunner-laravel example snippets
'providers' => [
// ... other providers
Spiral\RoadRunnerLaravel\Queue\QueueServiceProvider::class,
],
namespace App\Workers;
use Spiral\RoadRunnerLaravel\WorkerInterface;
use Spiral\RoadRunnerLaravel\WorkerOptionsInterface;
class CustomWorker implements WorkerInterface
{
public function start(WorkerOptionsInterface $options): void
{
// Your worker implementation goes here
// This method should handle requests from the RoadRunner server
}
}
return [
// ... other configuration options ...
'workers' => [
// Existing workers
Mode::MODE_HTTP => HttpWorker::class,
Mode::MODE_JOBS => QueueWorker::class,
// Your custom worker for a custom or built-in plugin
'custom_plugin' => \App\Workers\CustomWorker::class,
],
];