selim's avatar

Global variables

What is the best way to have global variables in Lumen and retrieve them like in Laravel (with Config::get())?

0 likes
4 replies
bobbybouwmann's avatar

Create a config file? What do you want to do? What is your use case here?

selim's avatar

I just have a bunch of strings to keep them in an array in a config file rather than in some controller or class. What I want to do is the equivalent of creating a file cfg.php in the config directory on laravel and returning an array with some key and then access it in the controller with

Config::get('cfg.key');

So far it won't work that way in lumen though.

Please or to participate in this conversation.