Normally in my controllers to access the data of a model I do
PaymentMethod::whereActive()->get();
PaymentMethod::all();
It happens that due to process optimization, this model can be handled directly in memory and not query the database for my clients.
$data = collect([...]); //data static
So I want to define a collection of data and through them continue to use the model to filter, when I do a Model::all() it returns the collection defined in $data, or a condition is applied to the collection to avoid accessing the db, in addition i want to avoid making a lot of changes as the model is used in multiple controllers
from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/3Ki6zct
via IFTTT
Aucun commentaire:
Enregistrer un commentaire