whiteki / simple-api-response
简单的封装 api 响应
0.0.5
2020-08-13 05:07 UTC
README
根据 手摸手教你让 Laravel 开发 API 更得心应手 https://learnku.com/articles/25947#9ea6b3 文章所写
方便个人使用
Include
- make:service
Installing
$ composer require whiteki/simple-api-response
Usage
- 修改 bootstrap/app.php 文件下绑定的异常处理类
$app->singleton( Illuminate\Contracts\Debug\ExceptionHandler::class, \Whiteki\SimpleApiResponse\Exceptions\Handler::class );
- 在 controller 里 use trait
use \Whiteki\SimpleApiResponse\ApiResponse;
- 新增 channel sqllog
'sqllog' => [ 'driver' => 'daily', 'path' => storage_path('logs/sql.log'), 'level' => 'debug', 'days' => 14, ];