24 lines
498 B
Markdown
24 lines
498 B
Markdown
# Lumen 的sql记录组件
|
||
|
||
引入该组件后,如果 APP_DEBUG = true 时,会自动将sql执行日志记录到 storage/logs/sql.log 中。
|
||
|
||
### 引入
|
||
```bash
|
||
composer config repositories.lumen-sql-logger vcs git@git.int.haowumc.com:arch/lumen-sql-logger.git
|
||
composer require --dev arch/lumen-sql-logger
|
||
```
|
||
|
||
### 开启
|
||
```php
|
||
if (env('APP_ENV') == 'local') {
|
||
$app->register(Arch\EventServiceProvider::class);
|
||
}
|
||
```
|
||
|
||
###配置
|
||
在.env中增加如下配置
|
||
```bash
|
||
APP_NAME = api
|
||
```
|
||
|