How to load a global setting? #74
Unanswered
eduardoarandah
asked this question in
Q&A
Replies: 2 comments
-
Hi @eduardoarandah, I think this should work: $settings = app(GeneralSettings::class);
Inertia::share("settings", [
"footer_message" => $settings->footer_message,
]); If that doesn't, try this: $settings = app(GeneralSettings::class);
Inertia::share("settings", [
"footer_message" => fn() => $settings->footer_message,
]); |
Beta Was this translation helpful? Give feedback.
0 replies
-
I've found that a good place for global vars is example:
|
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.
-
Let's say I want to load a
$footer_message
into all of my views.if I do this in
AppServiceProvider
:it works, however, migrations break:
I'm using database repostitory and tables don't exist when running migrations.
What would be the correct approach for settings that live globally? like a "footer message" in app layout?
Beta Was this translation helpful? Give feedback.
All reactions