日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

laravel 5.8 guzzle get 参数_Laravel速查表 Cache Cookie Request

發布時間:2025/3/20 编程问答 30 豆豆
生活随笔 收集整理的這篇文章主要介紹了 laravel 5.8 guzzle get 参数_Laravel速查表 Cache Cookie Request 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

文檔日期:2019年10月31日

鏈接信息見 https://learnku.com/docs/laravel-cheatsheet/5.8

Cache

// Cache cache() Cache::put('key','value',$second); Cache::put('key','value'); Cache::add('key','value',$seconds); Cache::forever('key','value'); Cache::sear('key',function(){return 'value';}); Cache::remember('key',$sceonds,function(){return 'value';}); Cache::rememberForever('key',function(){return 'value'}); Cache::forget('key'); Cache::has('key'); Cache::get('key','default'); Cache::get('key';function(){return 'default';});// 取到數據后再刪除之 Cache::pull('key'); //清空所有緩存 Cache::flush();Cache::increment('key'); Cache::increment('key',$amount); Cache::decrement('key'); Cache::decrement('key'$amount); Cache::tags('my-tag')->put('key','value',$seconds); Cache::tags('my-tag')->has('key'); Cache::tags(['people','artists'])->put('John',$john,$seconds); Cache::tags('my-tag')->forget('key'); Cache::tags('my-tag')->flush(); Cache::tags(['people','artists'])->flush();Cache::section('group')->put('key',$value); Cache::section('group')->get('key'); Cache::section('group')->flush(); Cache::tags(['people','artists'])->put('John',$john,$seconds);// ================輔助函數================== cache('key'); cache(['key'=>'value'],$seconds); cache(['key'=>'value',now()-addMinutes(10));// 使用回調函數操作緩存變量的內容 cache()->remember('users',$seconds,function(){return User::all();});// 執行緩存所使用的驅動 Cache::store('file')->get('foo'); Cache::store('redis')->put('name','Jack',600); // 使用redis緩存10分鐘// 事件所引用的類 'IlluminateCacheEventsCacheHit' => ['AppListenersLogCacheHit',], 'IlluminateCacheEventsCacheMissed' => ['AppListenersLogCacheMissed',], 'IlluminateCacheEventsKeyForgotten' => ['AppListenersLogKeyForgotten',], 'IlluminateCacheEventsKeyWritten' => ['AppListenersLogKeyWritten',],

Cookie

cookie(); request()->cookie('name'); Cookie::get('key'); Cookie::get('key','default'); Cookie::forever('key','value'); Cookie::make('key','value','minutes'); cookie('key','value','minutes'); //在回應之前先積累cookie,回應時統一返回 Cookie::queue('key','value','minutes');// 移除cookie Cookie::forget('key'); // 從response發送一個cookie $response = Reponse::make('hello world');// 注意,這個地方傳入的過期時間,是一個integer $response->withCookie(Cookie::make('name','value',$minutes)); // 設置未加密 Cookie AppHttpMiddlewareEncryptCookies.php EncryptCookies->except = ['cookie_name_1'];

Request

// 獲取請求參數 form-data 與 raw請求類型 request()->input(); // url: http://xx.com//aa/bb Request::url(); Request::path(); Request::getRequestUri(); Request::ip(); Request::getUri(); Request::getQueryString(); Request::getPort(); // 判斷當前請求的URI是否可被匹配 Request::is('foo/*'); // 獲取URI的分段值,從1開始 Request::segment(1); Request::header('Content-Type'); Request::server('PATH_INFO'); Request::ajax(); Request::secure(); Request::method(); Request::isMethod('post'); //獲取原始的post數據 Request::instance()->getContent(); //獲取請求要求返回的格式 Request::format(); Request::isJson();// 判斷HTTP Accept頭部信息是否為 application/json Request::wantsJson();

總結

以上是生活随笔為你收集整理的laravel 5.8 guzzle get 参数_Laravel速查表 Cache Cookie Request的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。