I want to store global settings in the database, that then will be editable from cPanel. I have a model Setting
, which has only 1 item with multiple columns such as siteName
, language
, siteDescription
and etc. I want to make these accessible in every view, so do I need to do
$settings = \MyApp\Setting::find(1);
for every single controller? Is there a way to define this variable somewhere globally and have it accessible in every single controller / view ?
Or perhaps this is not the correct way to do it?