dimanche 5 janvier 2020

Enabling / Disabling Features in a Laravel App

I'm building a Laravel app, which has a number of various features. I want to be able to enable or disable them depending on a particular domain's requirement. Currently, I have in my config a series of flags such as:

'is_feature_1_enabled' => true,
'is_feature_2_enabled' => false,

... and so on.

Then in my controllers and views, I check those config values to see whether or not I should be displaying something, allowing certain actions, etc. My app is starting to get polluted with these kinds of checks everywhere.

Is there a best practice method of managing features in a Laravel app?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire