vaened/laravel-route-moduler
Composer 安装命令:
composer require vaened/laravel-route-moduler
包简介
README 文档
README
Separate laravel routes by modules and submodules
└── routes └── api └── clients.php └── payments.php └── store.php
Installation
Laravel Route Moduler requires PHP 8.2. To get the latest version, simply require the project using Composer:
composer require vaened/laravel-route-moduler
Now. Publish the configuration file.
php artisan vendor:publish --tag='laravel-route-moduler'
Usage
Once the library is installed, you can start organizing your routes within the /routes/modules folder, which is the default location. If you prefer a different location, you can update it in the route-modules.php configuration file.
├── routes └── modules
Multiple Modules
The route-modules.php configuration file returns an array for a single module setup. However, you can configure as many modules as you need by extending this array.
└── routes └── api └── web └── app
This structure helps to keep your application’s routes organized, making maintenance and scalability easier.
Configuration
You can customize the behavior of the laravel-route-moduler package through the route-modules.php configuration file. Below are the available options:
• path: Specifies where the route configuration files for the module are located. You can set this to a directory or a single file.
Example:
Load all routes in a directory: 'path' => 'routes/modules'
Single route file: 'path' => 'routes/users.php'
• prefix: Adds a prefix to the module path when the module is created, helping to make modules independent and supplement filename prefixes.
Example:
'prefix' => 'admin'
• named: If true, the route file name will be used as a prefix for the routes defined in that file.
Example:
If the file is users.php, all routes will be prefixed with users.
• middleware: Defines the default middleware applied to all routes registered by the module.
Example:
'middleware' => ['web', 'auth']
These settings allow you to tailor the package to your application’s specific routing needs.
License
This library is licensed under the MIT License. For more information, please see the license file.
vaened/laravel-route-moduler 适用场景与选型建议
vaened/laravel-route-moduler 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 133.35k 次下载、GitHub Stars 达 2, 最近一次更新时间为 2023 年 04 月 19 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 vaened/laravel-route-moduler 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 vaened/laravel-route-moduler 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 133.35k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 16
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-04-19