Skip to content

WhiteKingdom/simple-api-response

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 

Repository files navigation

simple-api-response

根据 手摸手教你让 Laravel 开发 API 更得心应手 https://learnku.com/articles/25947#9ea6b3 文章所写

sql日志记录为 https://github.com/overtrue/laravel-query-logger

方便个人使用

Include

  • make:service

Installing

$ composer require whiteki/simple-api-response

Usage

  1. 修改 bootstrap/app.php 文件下绑定的异常处理类
$app->singleton(
    Illuminate\Contracts\Debug\ExceptionHandler::class,
    \Whiteki\SimpleApiResponse\Exceptions\Handler::class
);
  1. 在 controller 里 use trait
use \Whiteki\SimpleApiResponse\ApiResponse;
  1. 新增 channel sqllog
'sqllog' => [
    'driver' => 'daily',
    'path' => storage_path('logs/sql.log'),
    'level' => 'debug',
    'days' => 14,
];

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages