Download the PHP package spiral/roadrunner-laravel without Composer
On this page you can find all versions of the php package spiral/roadrunner-laravel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package roadrunner-laravel
RoadRunner ⇆ Laravel bridge
Easy way for connecting RoadRunner and Laravel applications (community integration).
Why Use This Package?
This package provides complete Laravel integration with RoadRunner, offering:
- Support for HTTP and other RoadRunner plugins like gRPC, Queue, KeyValue, and more.
- Temporal integration
- Full RoadRunner configuration control
[!TIP] There is an article that explains all the RoadRunner plugins.
Table of Contents
- Get Started
- Installation
- Configuration
- Starting the Server
- How It Works
- Supported Plugins
- HTTP Plugin
- Jobs (Queue) Plugin
- gRPC Plugin
- Temporal
- Custom Workers
- Support
- License
Get Started
Installation
First, install the Laravel Bridge package via Composer:
Publish the configuration file:
Download and install RoadRunner binary using DLoad:
Configuration
Create a .rr.yaml
configuration file in your project root:
Starting the Server
Start the RoadRunner server with:
How It Works
RoadRunner creates a worker pool by executing the command specified in the server configuration:
When RoadRunner creates a worker pool for a specific plugin,
it sets the RR_MODE
environment variable to indicate which plugin is being used.
The Laravel Bridge checks this variable to determine
which Worker class should handle the request based on your configuration.
The selected worker then listens for requests from the RoadRunner server and handles them using the Octane worker, which clears the application state after each task (request, command, etc.).
Supported Plugins
HTTP Plugin
The HTTP plugin enables serving HTTP requests with your Laravel application through RoadRunner.
Configuration
Ensure your .rr.yaml
has the HTTP section configured:
[!TIP] Read more about the HTTP plugin in the RoadRunner documentation.
Jobs (Queue) Plugin
The Queue plugin allows you to use RoadRunner as a queue driver for Laravel without additional services like Redis or a database.
Configuration
First, add the Queue Service Provider in config/app.php
:
Then, configure a new connection in config/queue.php
:
Update your .rr.yaml
file to include the Jobs section:
Set the QUEUE_CONNECTION
environment variable in your .env
file:
That's it! You can now dispatch jobs to the RoadRunner queue without any additional services like Redis or Database.
[!TIP] Read more about the Jobs plugin in the RoadRunner documentation.
gRPC Plugin
The gRPC plugin enables serving gRPC services with your Laravel application.
Configuration
Configure gRPC in your .rr.yaml
:
Then, add your gRPC services to config/roadrunner.php
:
Temporal
Temporal is a workflow engine that enables orchestration of microservices and provides sophisticated workflow mechanisms.
Configuration
First, configure Temporal in your .rr.yaml
:
Then, configure your workflows and activities in config/roadrunner.php
:
Download Temporal binary for development:
Start the Temporal dev server:
Useful Links
Custom Workers
The RoadRunner Laravel Bridge comes with several predefined workers for common plugins, but you can easily create your own custom workers for any RoadRunner plugin. This section explains how to create and register custom workers in your application.
Understanding Workers
Workers are responsible for handling requests from the RoadRunner server
and processing them in your Laravel application.
The predefined workers are configured in the config/roadrunner.php
file:
Creating Custom Workers
To create a custom worker, you need to implement the Spiral\RoadRunnerLaravel\WorkerInterface
.
This interface has a single method, start()
, which is called when the worker is started by the RoadRunner server:
Registering Custom Workers
After creating your custom worker, you need to register it in the config/roadrunner.php
file:
The key in the workers
array should match the value of the RR_MODE
environment variable
set by the RoadRunner server for your plugin.
Support
If you find this package helpful, please consider giving it a star on GitHub. Your support helps make the project more visible to other developers who might benefit from it!
If you find any package errors, please, make an issue in a current repository.
You can also sponsor this project to help ensure its continued development and maintenance.
License
MIT License (MIT). Please see LICENSE
for more information.
All versions of roadrunner-laravel with dependencies
spiral/roadrunner-kv Version ^4.0
spiral/roadrunner-jobs Version ^4.0
spiral/roadrunner-grpc Version ^3.5
laravel/octane Version ^2.9
spiral/roadrunner-http Version ^3.0
spiral/roadrunner-worker Version ^3.0
temporal/sdk Version ^2.0
internal/dload Version ^1.1