Accessing settings and registering them #138
Unanswered
danielcharrua
asked this question in
Q&A
Replies: 1 comment
-
In blade views you always need to use a fully qualified name, unless you're using Facades like Personally, I would retrieve the settings within my controller, and then pass them as variables into the views. Then you don't need fully qualified names within your views. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello, I'm struggling to get the settings in some Blade templates using
app(GeneralSettings::class)->app_logo_width
. This does return an errorClass GeneralSettings does not exist at .../vendor/laravel/framework/src/Illuminate/Container/Container.php:877
But if I use
app(App\Settings\GeneralSettings::class)->app_logo_width
works.I think that for some reason the GeneralSettings class is not registering into the container and can't be resolved.
Both setting classes are located under
app/Settings
and namespaced toApp\Settings\
My settings.php config file (maybe I'm registering them wrong):
Any ideas on what I'm doing wrong? Thank you.
Beta Was this translation helpful? Give feedback.
All reactions