jonston/amqp-laravel
最新稳定版本:v0.5.1
Composer 安装命令:
composer require jonston/amqp-laravel
包简介
Simple wrapper for amqp library to use in Laravel
README 文档
README
Simple wrapper for AMQP library to use in Laravel applications.
Installation
Install the package via Composer:
composer require jonston/amqp-laravel
Configuration
Publish the configuration file:
php artisan vendor:publish --tag=amqp-config
This will create a config/amqp.php file where you can set your RabbitMQ connection parameters.
Add these variables to your .env file:
AMQP_HOST=localhost AMQP_PORT=5672 AMQP_USER=guest AMQP_PASSWORD=guest AMQP_VHOST=/
Usage
Inject the AMQPService into your classes:
<?php namespace App\Http\Controllers; use Jonston\AmqpLaravel\AMQPService; class OrderController extends Controller { public function __construct( private AMQPService $amqpService ) {} public function processOrder() { // Use the AMQP service $this->amqpService->publish('order.created', $orderData); } }
Or resolve it from the container:
$amqpService = app(AMQPService::class);
Requirements
- PHP >= 8.1
- Laravel >= 9.0
License
MIT License
统计信息
- 总下载量: 9
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-08-06