Support the ongoing development of Laravel.io →
Input Views
Last updated 1 year ago.
0

I like the repository pattern, decouple the controller from the model. Plenty of stuff if you google around but a matter of personal choice. If you are on a personal learning curve it is well worth a gander.

0

Thanks !

I know the above pattern but can not figure out how to pass multiple values ​​to a view of different models, without soiling the controller :(

0

Like jacksoncharles said, use a repository to hide the logic. You could relate the models, load them all or just change the table on a single model and get all your data as a single array. You can then pass the result to the view without hard coding any var names.

0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

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

Your logo here?

Laravel.io

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

© 2024 Laravel.io - All rights reserved.