How to pass multiple models to laravel view?

Member

by addison , in category: PHP Frameworks , 10 months ago

How to pass multiple models to laravel view?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

by filiberto , 10 months ago

@addison 

To pass multiple models to a Laravel view, you can use an associative array or the compact() function.



Both methods will pass the models to the view, and you can then access and iterate over them in your view using Laravel's Blade templating engine.