Today I will show you how can I optimize Laravel Queries and reduce memory uses to making our application faster. I will use laravel sub-query and database raw query to make such kind of improvements.
I have a laravel code that actually visualize list of the users who are featured in the platform. Unfortunately this code takes 2453 queries to load this data to the admin user. Today, I will show you how to can improve it from there to only 4.
Building laravel dashboard will be one of the difficult tasks. The most challenging job for the dashboard is maintaining low amount of database queries, memory uses and processing time. Today, I will show you how to optimize an existing code that has 2882 number of queries for counting some stats and I will achieve the same result with the 2 queries only.