mardi 7 avril 2020

Store config in database in Laravel

I am currently using Laravel 5.2. I want to be able to store config properties (key-value pairs) in database, that I am willing to access from both my application on runtime and the console (either php artisan command or Tinker).

What is my best option?

  • .env is one way, but it is not stored in the database, but in a file.
  • Config::get is another way, but it also writes in files. Can it be configured to write in database?
  • Cache::get is setup to work with the database, but is temporary, not permanent, so it is out of question.

The reason I am interested in database config, is because we often replace/delete files during deployment. Also it would be nice to store values encrypted. Also important feature here is to be able to easily get values via either php artisan or tinker



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire