I'm new to Laravel and wonder what the best approach is to use global variables or constants based on values within the database. Let's assume users can specify the site name, theme, admin email, default_image, language. These values are stored in the database and should be used across all controllers and views:
$config->admin_name = 'Administrator';
It could then be easily be used all controllers, views, etc by : $this->config->item('admin_name');
What is the best approach in Laravel?
You might want to try this...
https://github.com/Grimthorr/laravel-user-settings
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With