I want some settings to be user-manageable. Because of this, I am storing them in database, retrieving and caching them afterwards. However, when I try to call Cache
facade inside the config/config.php
file, I get an error. Details are given below.
I have following code located in app/config/custom.php
:
<?php
// app/config/custom.php
use Illuminate\Support\Facades\Cache;
return [
'foo' => Cache::get('foo');
];
Which spits out a following error:
Fatal error: Call to a member function get() on a non-object in D:\www\project\vendor\laravel\framework\src\Illuminate\Support\Facades\Facade.php on line 216
How to fix this?