php artisan vendor:publish --provider="Yxx\\\\\\\\LaravelQuick\\\\\\\\LaravelQuickServiceProvider"windowsphp artisan vendor:publish --provider="Yxx\\\\LaravelQuick\\\\LaravelQuickServiceProvider"怎么使用異常使用例子
use Yxx\\\\LaravelQuick\\\\Exceptions\\\\Api\\\\ApiNotFoundException;// 請求參數(shù)錯誤throw new ApiRequestException();// 404 未找到throw new ApiNotFoundException();// 系統(tǒng)錯誤throw new ApiSystemException()// 未授權(quán)throw new ApiUnAuthException()自定義錯誤繼承Yxx\\\\LaravelQuick\\\\Exceptions自己參照對應(yīng)代碼自定義
api 接口使用
use Yxx\\\\LaravelQuick\\\\Traits\\\\JsonResponseTrait// 成功return $this->success("消息",['name'=>"張三"]);// 失敗return $this->error("錯誤");// 自定義return $this->apiResponse(Response::HTTP_BAD_GATEWAY,"502錯誤");
緩存的使用(封裝了 redis 的一些方法)
use Yxx\\\\LaravelQuick\\\\Facades\\\\CacheClient;CacheClient::hSet("test","1","張三");CacheClient::hGet("test","1");CacheClient::lPush("test","1");具體參考Yxx\\\\LaravelQuick\\\\Services\\\\CacheService里面的方法....
artisan 命令創(chuàng)建 Trait php artisan quick:create-trait test創(chuàng)建 Service php artisan quick:create-service Test/TestService創(chuàng)建 Repository php artisan quick:create-repository Test
更多關(guān)于云服務(wù)器,域名注冊,虛擬主機的問題,請訪問西部數(shù)碼官網(wǎng):m.ps-sw.cn