Skip to content

Commit

Permalink
resolve issue with config and load right values from config
Browse files Browse the repository at this point in the history
  • Loading branch information
muhamed-didovic committed Apr 15, 2019
1 parent b12efd6 commit 6017cd5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion config/throttle.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
*/

'driver' => 'file',

//same as above
'cache.driver' => 'file',
//path where the files will be stored
'cache.path' => '/tmp',
//default limit per route
Expand Down
6 changes: 3 additions & 3 deletions src/ThrottleApp.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ protected function setupCache()
{
$this->app->config->set('cache.default', $this->app->config->get('driver'));
$this->app->config->set('cache.stores.file', [
'driver' => $this->config['cache.driver'],
'path' => $this->app->config->get('driver')//$this->config['cache.path'],
'driver' => $this->app->config->get('driver'),
'path' => $this->app->config->get('cache.path')//$this->config['cache.path'],
]);
// $this->app['config'] = [
// 'cache.default' => $this->app->config->get('driver'),
Expand All @@ -118,7 +118,7 @@ protected function setupCache()
// 'path' => $this->config['cache.path'],
// ],
// ];

// To use the file cache driver we need an instance of Illuminate's Filesystem, also stored in the container
$this->app['files'] = new Filesystem;
$this->app->cache = new CacheManager($this->app);
Expand Down

0 comments on commit 6017cd5

Please sign in to comment.