From 1df466afd068194c3d28974378fc0b3b726dbf57 Mon Sep 17 00:00:00 2001 From: jiannei Date: Wed, 13 Mar 2024 14:38:52 +0800 Subject: [PATCH] doc: update --- README.md | 35 ++++++++++------------------------- 1 file changed, 10 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index b72986b..14aa7d9 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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 # 可选 ``` ## 配置 @@ -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 @@ -354,7 +360,7 @@ Response::noContent(); ```php public function fail() { - Response::fail();// 不需要加 return + return Response::fail(); } ``` @@ -387,7 +393,7 @@ public function fail() ```php public function fail() { - Response::fail('error');// 不需要加 return + return Response::fail('error'); } ``` @@ -408,7 +414,7 @@ public function fail() ```php public function fail() { - Response::fail('',ResponseCodeEnum::SERVICE_LOGIN_ERROR); + return Response::fail('',ResponseCodeEnum::SERVICE_LOGIN_ERROR); } ``` @@ -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)): - - - - - - - - - -

Pham Thao

🎨

guanguans

🐛
- - - - - - -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)