嗯 学习了!
哦 就是说首页展示的数据优先从缓存里读取,如果缓存没有(过期了),就从数据库查找。
那么反映在代码上,就是一个 if
判断 这样理解没错吧 ;)
老师 你要是能说下 cache 的实际应用场景就好了
像 session 的话,就我了解的,登录的用户信息就存在里面,注销账号的时候,也就是删掉 session 里的用户信息。
这是我的配置信息:
"require": {
"php": ">=5.5.9",
"laravel/framework": "5.1.*",
"dingo/api": "1.0.*@dev",
"lucadegasperi/oauth2-server-laravel": "5.1.*"
},
"require-dev": {
"fzaninotto/faker": "~1.4",
"mockery/mockery": "0.9.*",
"phpunit/phpunit": "~4.0",
"phpspec/phpspec": "~2.1"
},
学这节课时,我把5.4版本换到了5.1版本(因为oauth2-server-laravel不支持5.3+),没有安装jwt。
我的Laravel5.1只安装了 dingo 和 oauth2-server-laravel,没有安装 jwt。测试地址时
api.dev/oauth/authorize?client_id=ZoZgKTVUyiZLdvx0LYB2CBXXdnIfHRUw&redirect_uri=https://bing.com&response_type=code
报这样的错
ErrorException in Manager.php line 137:
call_user_func_array() expects parameter 1 to be a valid callback, class 'Illuminate\Auth\Guard' does not have a method 'handle'