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

Depends on the overall architecture of your application, but I, personally, would try and avoid options 3/4 as much as possible.

Also, I am not exactly sure what you're trying to do, but you could try the following..

Make a method within your controller that with make the view. Let is accept a parameter, like $query, and set it equal to your default query.

Wrap your images in anchor links that point to a route that will call your controller's method and pass the product's id in as a parameter (overriding the default parameter).

If these are two different views, then perhaps it would be best to use two different methods, or maybe even an entirely different controller. Again, your scenario leaves some room for interpretation, more details would be helpful

0

As @textbookcharlie said, forget about options 3 and 4.

What exactly is lightbox? A JQuery plugin? (I nerver used it) If so, I think the best solution is to bind a click event to your image and request the other images via AJAX. Anyway, it will depend on how lightbox works.

0

@textbookcharlie - this sounds like a good idea, i will try it, thanks. so do i need some js for that? i mean i want to open a new pop up window, and load the images inside it

@MateusAzevedo , lightbox is a js script that is supposed to help overlaying images etc, but i thought maybe i just rather use bootstrap modal window?

0

Sign in to participate in this thread!

Eventy

Your banner here too?

avieln avieln Joined 29 Jan 2015

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.