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相关推荐
- Laravel 速查表 Cache
// 获取缓存对象,约等于 Cache cache() // 注意 5.8 缓存单位为「秒」,之前版本为「分」 Cache::put('key', 'value', $seconds); // 未设置 ...
- Git 常用命令速查表(图文+表格)
一. Git 常用命令速查 git branch 查看本地所有分支 git status 查看当前状态 git commit 提交 git branch -a 查看所有的分支 git branch ...
- Git操作手册|命令速查表
Git操作手册|命令速查表 这篇文章主要介绍Git分布式版本管理与集中式管理的一些差异,总结下Git常用命令作为日后的速查表,最后介绍Git进阶的一些案例. 本文分为以下几个部分: Git与SVN差异 ...
- LightGBM用法速查表
LightGBM用法速查表 1.读取csv数据并指定参数建模 # coding: utf-8 import json import lightgbm as lgb import pandas as p ...
- 吴恩达的 CS229,有人把它浓缩成 6 张中文速查表!
点击上方"AI有道",选择"星标"公众号 重磅干货,第一时间送达 吴恩达在斯坦福开设的机器学习课 CS229,是很多人最初入门机器学习的课,历史悠久,而且仍然是 ...
- 初学者如何选择合适的机器学习算法(附算法速查表)
来源:机器之心 参与:黄小天.蒋思源.吴攀 校对:谭佳瑶 本文长度为4000字,建议阅读6分钟 本文针对算法的选择为你提供一些参考意见. 本文主要的目标读者是机器学习爱好者或数据科学的初学者,以及对学 ...
- Git 常用命令速查表(图文+表格)【转】
转自:http://www.jb51.net/article/55442.htm 一. Git 常用命令速查 git branch 查看本地所有分支 git status 查看当前状态 git co ...
- 吴恩达CS229速查表
吴恩达在斯坦福开设的机器学习课 CS229,是很多人最初入门机器学习的课,历史悠久,而且仍然是最经典的机器学习课程之一.当时因为这门课太火爆,吴恩达不得不弄了个超大的网络课程来授课,结果一不小心从斯坦 ...
- 常用Python标准库对象速查表(1)
封面图片:<Python程序设计基础(第2版)>,董付国,清华大学出版社 =============== 常用Python标准库对象速查表(1) 标准库 对象 简要说明 math sin( ...
最新文章
- vnx vmax分盘过程
- Ubuntu下 MySQL安装
- 2018年DApp分析 | 链塔区块链产业年鉴精选
- 员工没热情?这8个简单方法比加薪都管用
- 如何配置Filter过滤器处理JSP中文乱码
- JS基础:求一组数中的最大最小值,以及所在位置
- php 把查询数据转json格式,php将从数据库查询到的数据转化为json格式,并写入json文件中...
- cad动态块制作翻转_CAD黑科技丨300份动态图库让你制图速度飞起来丨动态块制作教程...
- TensorFlow进阶:CNN对CIFAR10图像分类
- 关于getX()getY()就可以获取到位置,找不到方法问题
- MNIST数据集下载与保存为图片格式
- 4g模块注册上网 移远_迅为干货 | Linux系统移远EC20 4G模块移植方法
- 【有限差分法】(一)有限差分法的基本流程与常用格式
- 添加logviewer用户
- 苹果手机桌面找不到计算机,苹果手机在我的电脑显示不出来怎么办
- DDR MC DFI PHY
- 1.槑 2.囧 3.烎 4.兲 5.氼 6.砳 7.嘦 8.嫑 9.嘂 10.圐圙 11.玊 12.孖 13.砼 怎么读
- Axure与markman
- idea 集成Git 遇到的问题 与解决
- 【读书笔记->统计学】04-02 利用概率理论预测和决策-条件概率、概率树、全概率公式、贝叶斯定理、相关与独立概念简介