定制 talovicnedim/laravel-queue-prefix 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

talovicnedim/laravel-queue-prefix

最新稳定版本:1.2.0

Composer 安装命令:

composer require talovicnedim/laravel-queue-prefix

包简介

Add prefix your laravel queues to support multiple environments.

README 文档

README

This package adds queue name prefixes in Laravel to avoid conflicts between different environments.

It's recommended to use separate queues for different environments when hosting under one cloud account.

By simplifying your queue management, you can improve your application's efficiency and avoid potential issues.

Installation

You can install the package via Composer:

composer require talovicnedim/laravel-queue-prefix

The package will automatically register itself. If, for some reason, the package is not registered automatically, you can add the following line to your config/app.php file:

'providers' => [
    // ...
    Talovicnedim\LaravelQueuePrefix\QueuePrefixServiceProvider::class,
],

You can publish the configuration file with:

php artisan vendor:publish --provider="Talovicnedim\LaravelQueuePrefix\QueuePrefixServiceProvider"

This will create a queue-prefix.php file in your config directory.

Usage

Once you have installed the package and published the configuration file, you can enable or disable prefixing of queue names by setting the enabled option in the configuration file.

return [
    'enabled' => true, // enable prefixing
    'prefix' => env('APP_ENV', 'prod') // the prefix to use (if enabled)
    'allowed_queues' => ['*'] // prefix all queues
    'excluded_queues' => [] // queues to exclude from prefixing
];

If prefixing is enabled, the package will automatically add the prefix to the names of all queues before they are dispatched.

For example, if you have a queue named emails, and your prefix is set to prod the queue name will be changed to prod-emails.

If prefixing is disabled, the package will not modify the names of queues before they are dispatched.

Documentation

You can learn more about how the package works by reading the blog post I published.

Testing

You can run the tests with:

composer test

Credits

License

The MIT License (MIT). Please see License File for more information.

统计信息

  • 总下载量: 1.27k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 7
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 7
  • Watchers: 1
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-08-12

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固