Support the ongoing development of →
Configuration Architecture
Last updated 1 year ago.

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)

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!


Your banner here too?


We'd like to thank these amazing companies for supporting us

Your logo here?

The Laravel portal for problem solving, knowledge sharing and community building.

© 2023 - All rights reserved.