laravel 5.8 guzzle get 参数_Laravel速查表 Cache Cookie Request
生活随笔
收集整理的這篇文章主要介紹了
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的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: aspen plus大小_AspenPl
- 下一篇: db2关闭下一句sql的日志_DB2_数