I think that is a bed solution, because reading the database is slower then read file system, and you would read it in every request beside selects for getting the data, so it's dramatically encumber database server so I didn't recommended that.
It depends I guess ...
To get around hitting the database you could save your query to cache.
Example code:
$languages = Cache::rememberForever('languages', function() {
return DB::table('locales')
->where('active', '=', 1)
->get();
});
To prevent warmup lag you could call that function every time you update/write to the database.
I am doing this for a menu package.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community