title: Laravel cache outside of laravel
body: <p>I've currently got laravel illuminate database and eloquent working outside of laravel.</p>
  
  <p>I'm now trying to get the cache working as well.</p>
  
  <p>This is what I have altogether now.</p>
  
  <pre><code>&lt;?php
  
  require dirname(dirname(__DIR__)) . '/vendor/autoload.php';
  require dirname(__DIR__) . '/config.php';
  
  use Illuminate\Database\Capsule\Manager as DB;
  use Illuminate\Cache\CacheManager as CacheManager;
  
  $dbc = new DB;
  
  $dbc-&gt;addConnection(array(
      'driver'    =&gt; 'mysql',
      'host'      =&gt; DB_HOST,
      'database'  =&gt; DB_NAME,
      'username'  =&gt; DB_USER,
      'password'  =&gt; DB_PASSWORD,
      'charset'   =&gt; 'utf8',
      'collation' =&gt; 'utf8_unicode_ci',
      'prefix'    =&gt; '',
  ));
  
  # Set the default fetch mode for all queries
  $dbc-&gt;setFetchMode(PDO::FETCH_CLASS);
  
  # Set up the cache
  $container = $dbc-&gt;getContainer();
  
  $container['config']['cache.driver'] = 'memcached';
  $container['config']['cache.memcached'] = array('host' =&gt; '127.0.0.1', 'port' =&gt; 11211, 'weight' =&gt; 100);
  
  $container-&gt;offsetGet('config')-&gt;offsetSet('cache.driver', 'array');
  
  $cacheManager = new CacheManager($container);
  
  $dbc-&gt;setCacheManager($cacheManager);
  
  $dbc-&gt;setAsGlobal();
  $dbc-&gt;bootEloquent();
  
  global $dbc;
  </code></pre>
  
  <p>This is not working for me, despite having memcached and php module memcached installed and working.</p>
  
  <p><strong>UPDATE</strong> I get no errors with this configuration. I am just not seeing anything coming into memcached. I've tested with the following line of code.</p>
  
  <pre><code>$dbc-&gt;table('users')-&gt;limit(10)-&gt;cacheTags(array('people', 'authors'))-&gt;remember(10)-&gt;get();
  </code></pre>
  
  <p>Whilst watching on the box with</p>
  
  <pre><code>[root@localhost vagrant]# telnet 127.0.0.1 11211
  Trying 127.0.0.1...
  Connected to 127.0.0.1.
  Escape character is '^]'.
  stats items
  END
  </code></pre>