rumus-bin / laravel-routes-attributes
Laravel 属性路由
dev-main
2022-10-07 17:52 UTC
Requires
- php: ^8.0|^8.1
- illuminate/contracts: ^8.70|^9.0
Requires (Dev)
- orchestra/testbench: ^6.0|^7.0
- phpunit/phpunit: ^9.3
This package is auto-updated.
Last update: 2024-09-07 22:08:44 UTC
README
该包需要 PHP 8 及以上版本。
此包受到了Spatie团队工作的启发,特别是他们的包:laravel-route-attributes。请在生产环境中使用上述包。
许可协议
MIT
责任
包的作者不对在生产环境中使用此包可能造成的任何损失承担责任。作者也不接受有关此包性能或不可用性的任何评论。您可以自由使用此包的所有程序代码,但仅限于您自己的责任。作者不保证以任何方式支持、安全性和更新此包。
安装后使用 artisan 命令发布配置
php artisan vendor:publish --provider="RumusBin\AttributesRouter\AttributesRouterProvider" --tag="config"这将发布配置类:return [ /* * 只有当此设置为true时,才会自动注册路由 */ 'enabled' => true,
/*
* Controllers in these directories that have routing attributes
* will automatically be registered.
*
* Optionally, you can specify group configuration by using key/values
*/
'directories' => [
app_path('Http/Controllers'),
app_path('Http/Controllers/Web') => [
'middleware' => ['web']
],
app_path('Http/Controllers/Api') => [
'prefix' => 'api',
'middleware' => 'api'
],
],
]; `