Don't render dude

Hello! I am pretty sure there is always something like this, but I don’t remember from screencasts. So I have one method that returns collection getCategories(), but I don’t want to call it on every render, how can I fix it?

1 Like

I believe what you are looking for is caching (https://laravel.com/docs/8.x/cache#cache-usage). There’s a good example in Caleb’s screencast here: https://laravel-livewire.com/screencasts/s7-caching. Hope this helps.

PS Don’t forget that this forum has been shut down and isn’t in active use. Going forward, you should post your Livewire-related questions at https://github.com/livewire/livewire/discussions