Skip to content

Commit a6d8ca0

Browse files
committed
Update docs
1 parent 7ffcea3 commit a6d8ca0

File tree

3 files changed

+90
-36
lines changed

3 files changed

+90
-36
lines changed

README-EN.md

Lines changed: 33 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
# laravel-soar
2-
31
![](docs/debug-bar.png)
42

3+
# laravel-soar
4+
55
> SQL optimizer and rewriter for laravel. - laravel 的 SQL 优化器和重写器。
66
77
[![Tests](https://github.com/guanguans/laravel-soar/workflows/Tests/badge.svg)](https://github.com/guanguans/laravel-soar/actions)
88
[![Check & fix styling](https://github.com/guanguans/laravel-soar/workflows/Check%20&%20fix%20styling/badge.svg)](https://github.com/guanguans/laravel-soar/actions)
9-
[![codecov](https://codecov.io/gh/guanguans/laravel-soar/branch/main/graph/badge.svg?token=URGFAWS6S4)](https://codecov.io/gh/guanguans/laravel-soar)
9+
[![codecov](https://codecov.io/gh/guanguans/laravel-soar/branch/master/graph/badge.svg?token=EWBG8GV4JD)](https://codecov.io/gh/guanguans/laravel-soar)
1010
[![Latest Stable Version](https://poser.pugx.org/guanguans/laravel-soar/v)](//packagist.org/packages/guanguans/laravel-soar)
1111
[![Total Downloads](https://poser.pugx.org/guanguans/laravel-soar/downloads)](//packagist.org/packages/guanguans/laravel-soar)
1212
[![License](https://poser.pugx.org/guanguans/laravel-soar/license)](//packagist.org/packages/guanguans/laravel-soar)
@@ -59,16 +59,41 @@ $app->register(\Guanguans\LaravelSoar\SoarServiceProvider::class);
5959

6060
## Usage
6161

62-
### Automatically monitor output sql score
62+
### Monitor output SQL score
6363

6464
![](docs/debug-bar.png)
6565

66-
### Example of use
66+
### Interface method
6767

6868
```php
69-
$soar = app('soar'); // get soar instance
70-
User::query()->ddSoarJsonScore() // Convenience query method to output scoring report
71-
\Soar::jsonScore(User::query()->toRawSql()); // soar facade generates scoring report
69+
$soar = app('soar'); // 获取 Soar 实例
70+
71+
/**
72+
* Soar 门面.
73+
*
74+
* @method static string score(string $sql) // SQL 评分
75+
* @method static array arrayScore(string $sql) // SQL 数组格式评分
76+
* @method static string jsonScore(string $sql) // SQL json 格式评分
77+
* @method static string htmlScore(string $sql) // SQL html 格式评分
78+
* @method static string mdScore(string $sql) // SQL markdown 格式评分
79+
* @method static string explain(string $sql) // explain 解读信息
80+
* @method static string mdExplain(string $sql) // markdown 格式 explain 解读信息
81+
* @method static string htmlExplain(string $sql) // html 格式 explain 解读信息
82+
* @method static null|string syntaxCheck(string $sql) // 语法检查
83+
* @method static string fingerPrint(string $sql) // SQL 指纹
84+
* @method static string pretty(string $sql) // 格式化 SQL
85+
* @method static string md2html(string $sql) // markdown 转 html
86+
* @method static string help() // Soar 帮助
87+
* @method static null|string exec(string $command) // 执行任意 Soar 命令
88+
* @method static string getSoarPath() // 获取 Soar 路径
89+
* @method static array getOptions() // 获取 Soar 配置选项
90+
* @method static \Guanguans\SoarPHP\Soar setSoarPath(string $soarPath) // 设置 Soar 路径
91+
* @method static \Guanguans\SoarPHP\Soar setOption(string $key, $value) // 设置 Soar 配置选项
92+
* @method static \Guanguans\SoarPHP\Soar setOptions(array $options) // 批量设置 Soar 配置选项
93+
*
94+
* @see \Guanguans\SoarPHP\Soar
95+
*/
96+
class Soar{}
7297
```
7398

7499
## Testing

README.md

Lines changed: 33 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
# laravel-soar
2-
31
![](docs/debug-bar.png)
42

3+
# laravel-soar
4+
55
> SQL optimizer and rewriter for laravel. - laravel 的 SQL 优化器和重写器。
66
77
[简体中文](README.md) | [ENGLISH](README-EN.md)
88

99
[![Tests](https://github.com/guanguans/laravel-soar/workflows/Tests/badge.svg)](https://github.com/guanguans/laravel-soar/actions)
1010
[![Check & fix styling](https://github.com/guanguans/laravel-soar/workflows/Check%20&%20fix%20styling/badge.svg)](https://github.com/guanguans/laravel-soar/actions)
11-
[![codecov](https://codecov.io/gh/guanguans/laravel-soar/branch/main/graph/badge.svg?token=URGFAWS6S4)](https://codecov.io/gh/guanguans/laravel-soar)
11+
[![codecov](https://codecov.io/gh/guanguans/laravel-soar/branch/master/graph/badge.svg?token=EWBG8GV4JD)](https://codecov.io/gh/guanguans/laravel-soar)
1212
[![Latest Stable Version](https://poser.pugx.org/guanguans/laravel-soar/v)](//packagist.org/packages/guanguans/laravel-soar)
1313
[![Total Downloads](https://poser.pugx.org/guanguans/laravel-soar/downloads)](//packagist.org/packages/guanguans/laravel-soar)
1414
[![License](https://poser.pugx.org/guanguans/laravel-soar/license)](//packagist.org/packages/guanguans/laravel-soar)
@@ -61,16 +61,41 @@ $app->register(\Guanguans\LaravelSoar\SoarServiceProvider::class);
6161

6262
## 使用
6363

64-
### 自动监控输出 sql 评分
64+
### 监控输出 SQL 评分
6565

6666
![](docs/debug-bar.png)
6767

68-
### 使用示例
68+
### 接口方法
6969

7070
```php
71-
$soar = app('soar'); // 获取 soar 实例
72-
User::query()->ddSoarJsonScore() // 便捷查询器方法输出评分报告
73-
\Soar::jsonScore(User::query()->toRawSql()); // soar 门面生成评分报告
71+
$soar = app('soar'); // 获取 Soar 实例
72+
73+
/**
74+
* Soar 门面.
75+
*
76+
* @method static string score(string $sql) // SQL 评分
77+
* @method static array arrayScore(string $sql) // SQL 数组格式评分
78+
* @method static string jsonScore(string $sql) // SQL json 格式评分
79+
* @method static string htmlScore(string $sql) // SQL html 格式评分
80+
* @method static string mdScore(string $sql) // SQL markdown 格式评分
81+
* @method static string explain(string $sql) // explain 解读信息
82+
* @method static string mdExplain(string $sql) // markdown 格式 explain 解读信息
83+
* @method static string htmlExplain(string $sql) // html 格式 explain 解读信息
84+
* @method static null|string syntaxCheck(string $sql) // 语法检查
85+
* @method static string fingerPrint(string $sql) // SQL 指纹
86+
* @method static string pretty(string $sql) // 格式化 SQL
87+
* @method static string md2html(string $sql) // markdown 转 html
88+
* @method static string help() // Soar 帮助
89+
* @method static null|string exec(string $command) // 执行任意 Soar 命令
90+
* @method static string getSoarPath() // 获取 Soar 路径
91+
* @method static array getOptions() // 获取 Soar 配置选项
92+
* @method static \Guanguans\SoarPHP\Soar setSoarPath(string $soarPath) // 设置 Soar 路径
93+
* @method static \Guanguans\SoarPHP\Soar setOption(string $key, $value) // 设置 Soar 配置选项
94+
* @method static \Guanguans\SoarPHP\Soar setOptions(array $options) // 批量设置 Soar 配置选项
95+
*
96+
* @see \Guanguans\SoarPHP\Soar
97+
*/
98+
class Soar{}
7499
```
75100

76101
## 测试

src/Facades/Soar.php

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -10,30 +10,34 @@
1010

1111
namespace Guanguans\LaravelSoar\Facades;
1212

13+
use Illuminate\Support\Facades\Facade;
14+
1315
/**
14-
* @method static getSoarPath()
15-
* @method static setSoarPath(string $soarPath)
16-
* @method static getOptions()
17-
* @method static setOption(string $key, $value)
18-
* @method static setOptions(array $options)
19-
* @method static score(string $sql)
20-
* @method static jsonScore(string $sql)
21-
* @method static arrayScore(string $sql)
22-
* @method static htmlScore(string $sql)
23-
* @method static mdScore(string $sql)
24-
* @method static exec(string $command)
25-
* @method static explain(string $sql)
26-
* @method static mdExplain(string $sql)
27-
* @method static htmlExplain(string $sql)
28-
* @method static syntaxCheck(string $sql)
29-
* @method static fingerPrint(string $sql)
30-
* @method static pretty(string $sql)
31-
* @method static md2html(string $sql)
32-
* @method static help()
16+
* Soar 门面.
17+
*
18+
* @method static string score(string $sql) // SQL 评分
19+
* @method static array arrayScore(string $sql) // SQL 数组格式评分
20+
* @method static string jsonScore(string $sql) // SQL json 格式评分
21+
* @method static string htmlScore(string $sql) // SQL html 格式评分
22+
* @method static string mdScore(string $sql) // SQL markdown 格式评分
23+
* @method static string explain(string $sql) // explain 解读信息
24+
* @method static string mdExplain(string $sql) // markdown 格式 explain 解读信息
25+
* @method static string htmlExplain(string $sql) // html 格式 explain 解读信息
26+
* @method static null|string syntaxCheck(string $sql) // 语法检查
27+
* @method static string fingerPrint(string $sql) // SQL 指纹
28+
* @method static string pretty(string $sql) // 格式化 SQL
29+
* @method static string md2html(string $sql) // markdown 转 html
30+
* @method static string help() // Soar 帮助
31+
* @method static null|string exec(string $command) // 执行任意 Soar 命令
32+
* @method static string getSoarPath() // 获取 Soar 路径
33+
* @method static array getOptions() // 获取 Soar 配置选项
34+
* @method static \Guanguans\SoarPHP\Soar setSoarPath(string $soarPath) // 设置 Soar 路径
35+
* @method static \Guanguans\SoarPHP\Soar setOption(string $key, $value) // 设置 Soar 配置选项
36+
* @method static \Guanguans\SoarPHP\Soar setOptions(array $options) // 批量设置 Soar 配置选项
3337
*
3438
* @see \Guanguans\SoarPHP\Soar
3539
*/
36-
class Soar extends \Illuminate\Support\Facades\Facade
40+
class Soar extends Facade
3741
{
3842
public static function getFacadeAccessor()
3943
{

0 commit comments

Comments
 (0)