Accessing settings in Blade #98
Replies: 3 comments
-
Hi @nwconsulting you can create an instance through app(GeneralSettings::class) directly in blade with the whole namespace of the class, for example:
Or
But ideal I think is to use a controller to give the responsibility of data to it and pass it to the view. I hope this can be helpfully for you. Regards. |
Beta Was this translation helpful? Give feedback.
-
Actually, I created a helper class for calling settings in Blade
And I added this class to Config/App.php under aliases
Now I use this for calling settings in blade pages
I don't know whether as it's supposed to be or not but it works as I want for me now :) |
Beta Was this translation helpful? Give feedback.
-
I have passed the settings like this in the
|
Beta Was this translation helpful? Give feedback.
-
Sorry for the nubee question.
I am trying to access the settings in Blade but not sure how to do this. I want to be able check if a setting has a specific value and if so then do something.
Beta Was this translation helpful? Give feedback.
All reactions