try { $var = \Cache::get('cache_key'); } catch (\CacheNotFoundException $e) { // determine the var value $var = 'value to cache'; // store it in the case for 60 seconds \Cache::set('cache_key', $var, 60); }
It looks like you're new here. If you want to get involved, click one of these buttons!