The cache function may be used to get values from the cache. If the given key does not exist in the cache, an optional default value will be returned:
<?php $value = cache('key');

$value = cache('key', 'default');
<?php         $app['cache'] = $cache = m::mock(stdClass::class);




        $this->assertInstanceOf(stdClass::class, cache());




        $cache->shouldReceive('put')->once()->with('foo', 'bar', 1);
<?php         $cache->shouldReceive('put')->once()->with('foo', 'bar', 1);

        cache(['foo' => 'bar'], 1);




        $cache->shouldReceive('get')->once()->with('foo')->andReturn('bar');
<?php         $cache->shouldReceive('get')->once()->with('foo')->andReturn('bar');

        $this->assertSame('bar', cache('foo'));




        $cache->shouldReceive('get')->once()->with('foo', null)->andReturn('bar');
<?php         $cache->shouldReceive('get')->once()->with('foo', null)->andReturn('bar');

        $this->assertSame('bar', cache('foo', null));




        $cache->shouldReceive('get')->once()->with('baz', 'default')->andReturn('default');
<?php         $cache->shouldReceive('get')->once()->with('baz', 'default')->andReturn('default');

        $this->assertSame('default', cache('baz', 'default'));

    }



    public function testMixDoesNotIncludeHost()