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:
$value cache('key');

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




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




        
$cache->shouldReceive('put')->once()->with('foo''bar'1);
        $cache->shouldReceive('put')->once()->with('foo''bar'1);

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




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

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




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

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




        
$cache->shouldReceive('get')->once()->with('baz''default')->andReturn('default');
        $cache->shouldReceive('get')->once()->with('baz''default')->andReturn('default');

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

    }



    public function 
testMixDoesNotIncludeHost()