oanhnn/laravel-handlers
Composer 安装命令:
composer require oanhnn/laravel-handlers
包简介
Using handler class instead of controller class in Laravel 5.5+ application
README 文档
README
Using handler class instead of controller class in Laravel 5.5+
Requirements
- php >=7.1.3
- Laravel 5.5+
Laravel 6.0+ requires php 7.2+
Installation
Begin by pulling in the package through Composer.
$ composer require oanhnn/laravel-handlers
Laravel
After that, publish vendor's resources:
$ php artisan vendor:publish --tag=laravel-handlers-config
Lumen
After that, copy the config file from the vendor directory:
$ cp vendor/oanhnn/laravel-handlers/config/handlers.php config/handlers.php
Update base handler class to your class in config/handlers.php.
Register the config file and the service provider in bootstrap/app.php:
$app->configure('handlers'); $app->register(Laravel\Handlers\ServiceProvider::class);
Usage
Create handler class
Create new handler class by run command
$ php artisan make:handler ShowProfile
You can use --force option to force create handler class (override existed class)
$ php artisan make:handler --force ShowProfile
Configure
You can change namespace of handler classes by config namespace in config/handlers.php file.
'namespace' => '\\App\\Http\\Api',
You can change base handler class by config base in config/handlers.php file.
'base' => '\App\Http\Controllers\Controller::class',
Customize handler stub
If you want customize stub file, please run:
$ php artisan vendor:publish --tag=laravel-handlers-stubs
Changelog
See all change logs in CHANGELOG
Testing
$ git clone git@github.com/oanhnn/laravel-handlers.git /path
$ cd /path
$ composer install
$ composer phpunit
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email to Oanh Nguyen instead of using the issue tracker.
Credits
License
This project is released under the MIT License.
Copyright © Oanh Nguyen.
oanhnn/laravel-handlers 适用场景与选型建议
oanhnn/laravel-handlers 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 32 次下载、GitHub Stars 达 2, 最近一次更新时间为 2018 年 10 月 07 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「package」 「controller」 「laravel」 「handler」 「actions」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 oanhnn/laravel-handlers 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 oanhnn/laravel-handlers 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 oanhnn/laravel-handlers 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Give your JS App some Backbone with Models, Views, Collections, and Events.
Simple ASCII output of array data
Create mail from controller action render
Extended auth components for Yii2
Alfabank REST API integration
统计信息
- 总下载量: 32
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-10-07