Skip to content

Commit

Permalink
doc: update
Browse files Browse the repository at this point in the history
  • Loading branch information
jiannei committed Mar 13, 2024
1 parent f43d75f commit 1df466a
Showing 1 changed file with 10 additions and 25 deletions.
35 changes: 10 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
| 7.* | 7.* | ^3.0 | ^2.0 |
| 8.* | 8.* | ^4.0 | ^3.0 |
| 9.* - 10.* | 9.* - 10.* | ^5.0 | ^3.0 |
| 11.* | 不支持 | ^6.0 | ^3.0 |


```shell
Expand Down Expand Up @@ -80,6 +81,11 @@ composer require jiannei/laravel-enum "^3.0" -vvv # 可选

composer require jiannei/laravel-response "^5.0" -vvv
composer require jiannei/laravel-enum "^3.0" -vvv # 可选

# laravel 11.x

composer require jiannei/laravel-response "^6.0" -vvv
composer require jiannei/laravel-enum "^3.0" -vvv # 可选
```

## 配置
Expand All @@ -92,7 +98,7 @@ composer require jiannei/laravel-enum "^3.0" -vvv # 可选
$ php artisan vendor:publish --provider="Jiannei\Response\Laravel\Providers\LaravelServiceProvider"
```

- 格式化异常响应
- 格式化异常响应(laravel 11 可省略这一步)


```php
Expand Down Expand Up @@ -354,7 +360,7 @@ Response::noContent();
```php
public function fail()
{
Response::fail();// 不需要加 return
return Response::fail();
}
```

Expand Down Expand Up @@ -387,7 +393,7 @@ public function fail()
```php
public function fail()
{
Response::fail('error');// 不需要加 return
return Response::fail('error');
}
```

Expand All @@ -408,7 +414,7 @@ public function fail()
```php
public function fail()
{
Response::fail('',ResponseCodeEnum::SERVICE_LOGIN_ERROR);
return Response::fail('',ResponseCodeEnum::SERVICE_LOGIN_ERROR);
}
```

Expand Down Expand Up @@ -599,27 +605,6 @@ return [

[![](https://resources.jetbrains.com/storage/products/company/brand/logos/jb_beam.svg)](https://www.jetbrains.com/?from=https://github.com/jiannei)

## Contributors ✨

Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):

<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
<!-- prettier-ignore-start -->
<!-- markdownlint-disable -->
<table>
<tr>
<td align="center"><a href="https://github.com/vanthao03596"><img src="https://avatars.githubusercontent.com/u/34786441?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Pham Thao</b></sub></a><br /><a href="#design-vanthao03596" title="Design">🎨</a></td>
<td align="center"><a href="https://www.guanguans.cn"><img src="https://avatars.githubusercontent.com/u/22309277?v=4?s=100" width="100px;" alt=""/><br /><sub><b>guanguans</b></sub></a><br /><a href="https://github.com/jiannei/laravel-response/issues?q=author%3Aguanguans" title="Bug reports">🐛</a></td>
</tr>
</table>

<!-- markdownlint-restore -->
<!-- prettier-ignore-end -->

<!-- ALL-CONTRIBUTORS-LIST:END -->

This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!

## Stargazers over time

[![Stargazers over time](https://starchart.cc/jiannei/laravel-response.svg)](https://starchart.cc/jiannei/laravel-response)
Expand Down

0 comments on commit 1df466a

Please sign in to comment.