clean-bandits/single-action-resource-controllers-for-laravel
最新稳定版本:v1.2.0
Composer 安装命令:
composer require clean-bandits/single-action-resource-controllers-for-laravel
包简介
README 文档
README
This package extends Laravel Router with new feature - Route::singleActionResource()
It's combination of Route::resource together
with Single Action Controllers.
If you are interested in small highly cohesive controller classes that follow standard naming convention this package is
definitely for you.
How does it work?
It's really simple:
- Just add new single action resource route in your routes file, e.g
Route::singleActionResource('photos'); - Create new Single Action Controllers for each
action you need, like this:

- This will automatically create these routes:

Installation
You can install the package via composer:
composer require clean-bandits/single-action-resource-controllers-for-laravel
Optionally you can publish the config file with:
php artisan vendor:publish --provider="CleanBandits\SingleActionResourceControllers\SingleActionResourceControllersProvider" --tag="config"
This is the contents of the published configuration file:
return [ /* * Specify root namespace where your single action resource controller folder will reside */ 'controllers_namespace' => 'App\\Http\\Controllers\\', /* * This class is responsible for building Resource controllers naming and location. * By default they reside inside namespace -> controllers_namespace+resource_name+action, * e.g. App\Http\Controllers\Photos\IndexController * To take full control of controller namespace creation, * you can provide your own class that implements ResourceController */ 'resource_controller' => DefaultResourceController::class, ];
Testing
composer test
统计信息
- 总下载量: 2.02k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-05-30