Browse Source

Basic cache API

Frederic G. MARAND 7 years ago
parent
commit
cdfad76986
1 changed files with 7 additions and 2 deletions
  1. 7 2
      routes/web.php

+ 7 - 2
routes/web.php

@@ -11,6 +11,11 @@
 |
 */
 
-Route::get('/', function () {
-    return view('welcome');
+$this->get('/', function (Illuminate\Contracts\Cache\Factory $cache) {
+    /** @var \Illuminate\Contracts\Cache\Store $store */
+    $store = $cache->store();
+    $cid = 'some cid';
+    $store->put($cid, 'value', 10);
+    $v = $store->get($cid);
+    return $v;
 });