php - Laravel : create a helper or a model method to fetch data, which one is the best practice? -


I have some advice about that.

I have to run a query that returns a list of items from the optional database of the returned web app. This list of items will go inside a form that will be put on the web app's database, so the list will not be modified. .

Now my question comes: what should I do? What is the best practice? Will not that similar data be modified to help bring that list? Or to create a normal model for such requests?

Thank you!

If it's touching a database, then you're probably doing it best in a model. You can assign a model to a model that has many databases with you, so that you can connect some models to your optional database and collect data as needed. You want to do something like those models to Legacy (if they represent legacy data, for example).

If the data is not changing, then you may also consider using it to clean the memo () method or otherwise caching the data so that it is same There will be no need to query the data several times.


Comments

Popular posts from this blog

winforms - C# Form - Property Change -

java - Messages from .properties file do not display UTF-8 characters -

javascript - amcharts makechart not working -