once() helper function in Laravel
In a nutshell, once() helper function of Laravel runs the codes inside it’s callback only once in a request lifecycle and caches it so that when you make another call later it will return the cached value instead of running the codes inside the callback again. Let’s see that in more details with some examples