Rediska's avatar

How to send a query to the database after the page has been rendered?

I would like to ask you, does Laravel have a pre-installed ability to load data after page rendering? I'll try to explain with an example: For example, on the product catalog page I have:

  1. available product filters
  2. goods Now I receive all the necessary data (products + attributes) in the model and are transferred to the view. The content is rendered only after all values have been received. Is it possible to make the received products appear on the site immediately, and the available filters only after they have been fully loaded?
0 likes
1 reply
Kachelle's avatar

The concept you are describing is Lazy loading. Render the page fast, with some data, and the slower stuff comes after.

In the Laravel world, without using a lot of JS, you can use Livewire. This is the page you are looking for I think:

https://livewire.laravel.com/docs/lazy

1 like

Please or to participate in this conversation.