12 2020 档案

摘要:使用前请先配置 redis或其他的缓存配置 :注意Laravel框架中缓存有效时间单位的设置在不同版本中存在差异 导入:use Cache; 添加一个缓存 $minutes为过期时间 Cache::put('key', 'value', $minutes); 设置永久缓存 Cache::foreve 阅读全文
posted @ 2020-12-30 11:18 『學無止境』 阅读(3398) 评论(0) 推荐(0)
摘要:Laravel 中默认使用的时间处理类就是 Carbon。 //安装 可以通过 Composer 来安装 Carbon: composer require nesbot/carbon PS:由于 Laravel 项目已默认安装了此包,所以不需要再次执行上面的命令。 //使用 你需要通过命名空间导入 阅读全文
posted @ 2020-12-29 18:09 『學無止境』 阅读(2487) 评论(0) 推荐(0)
摘要:// 取回数据表的第一条数据(一维数组 ) DB::table('table')->where('key', 'value')->first(); DB::table('table')->first(); // 从单行中取出单列数据 (非数组变量) DB::table('users')->where 阅读全文
posted @ 2020-12-29 17:38 『學無止境』 阅读(831) 评论(0) 推荐(0)