Passing sizeable data to view (Best Practice)

Posted 1 year ago by ochirach


Version 5.4

What is the best practice method of passing data from the database (via controller) to the view in Laravel?

I have a 'user' view that displays all kinds of user information.

Names, Birthday, address, numbers, etc

Should I cram all this eloquent database logic to a single method (public index(){}) then store all in arrays relating to the data types (i.e names array, addresses array) as this information is to appear onload?


Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.