What is the correct way to load data from a databse once for use everywhere? |
(02-11-2023, 02:52 PM)kenjis Wrote:(02-11-2023, 08:32 AM)objecttothis Wrote: From what I can tell that will work, but unless I'm mistaken, every time config('foo')->bar gets called its going to call the constructor and pull all that data down from the database. This defeats the purpose of trying to "load it into memory" once for use everywhere. Sounds like you are both saying Factories. Is there an advantage that factories has over loading the table values into session data and then referencing them using session('key');? |
Messages In This Thread |
What is the correct way to load data from a databse once for use everywhere? - by objecttothis - 02-11-2023, 08:32 AM
RE: What is the correct way to load data from a databse once for use everywhere? - by qury - 02-11-2023, 02:22 PM
RE: What is the correct way to load data from a databse once for use everywhere? - by kenjis - 02-11-2023, 02:52 PM
RE: What is the correct way to load data from a databse once for use everywhere? - by objecttothis - 02-11-2023, 03:16 PM
RE: What is the correct way to load data from a databse once for use everywhere? - by kenjis - 02-11-2023, 05:29 PM
RE: What is the correct way to load data from a databse once for use everywhere? - by objecttothis - 02-12-2023, 09:46 AM
RE: What is the correct way to load data from a databse once for use everywhere? - by InsiteFX - 02-14-2023, 12:54 AM
|