Closed metadevstudio closed 5 months ago
I'm also having the same problem. This error happens because the help settings calls the Cache::remember facade, I think it has not yet been initialized in the service container. Now I don't know if there is an alternative for this.
Hi, @metadevstudio, @leonardyrj For Laravel, it is not normal to make queries in config files. You can create Middleware like LoadGlobalConfig, in which you can do the following:
class LoadGlobalConfig
{
public function handle(Request $request, Closure $next): Response
{
config([
'key' => settings(...),
]);
}
}
Error when trying to use the settings helper on some config file like "config/app.php":
A facade root has not been set. {"exception":"[object] (RuntimeException(code: 0): A facade root has not been set. at nova/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php:350) [stacktrace]
0 nova/vendor/stepanenko3/nova-settings/src/helpers.php(27): Illuminate\Support\Facades\Facade::__callStatic()