Laravel 7 min read

Slow Laravel dashboard: what I measure to find the delay

Laravel dashboard loading slowly? How I trace database queries, API delays and page rendering, then scope a performance fix for your business application.

Slow Laravel dashboard: what I measure to find the delay

A slow Laravel dashboard is more than an irritating loading animation when staff need it to process orders, check stock or answer a customer. I would start with the action that holds up the work: opening the page, changing a filter, loading the next set of records or saving a change.

The useful question is where that wait happens. It could be a database query, repeated work in the application, a remote service or a browser trying to render too much data. A performance fix should follow that evidence and preserve the information and permissions the business relies on.

Describe one slow action precisely

I would pick a reproducible example and record the page, user role, filters and approximate time. Does the delay happen for everyone, only for one customer account or only when a longer date range is selected? Did it start after a release, or develop as the data grew?

Those details define the investigation. A dashboard with a small demonstration dataset can behave differently from the same page with years of orders. I would want a test environment with representative data volumes and an agreed way to protect customer information.

For a business owner, a short recording of the affected task and a description of its impact are enough to start the conversation. You do not need to identify a faulty SQL statement yourself.

Separate the server response from browser rendering

I would inspect the request that delivers the slow page or its data. How long does the server take to respond? How large is the response? Does the page then make additional requests before it becomes usable?

A quick response followed by a long browser pause suggests a different investigation from a request that spends most of its time waiting for the server. I would check the relevant timeline rather than treat both as the same Laravel database problem.

I would also follow any external calls made during the request. As a hypothetical example, a stock screen might wait for a supplier API before showing local information. Improving the local order query would not remove that remote wait. The repair might involve changing when the external data is refreshed and making its age visible to staff.

Measure database work across the request

Laravel documents query event listeners through DB::listen. These expose the executed query, bindings and duration for investigation. The same documentation describes whenQueryingForLongerThan, which can trigger a callback when cumulative database time in a request exceeds a chosen threshold.

I would use suitable instrumentation for the application's installed version and environment. Query bindings can contain customer data, so I would decide what to capture, who can see it and how long to retain it. Adding unrestricted SQL logging to a busy production system is not my default investigation plan.

Then I would group the evidence. One expensive query, many repeated queries and a large amount of application work between queries need different repairs. Query count is useful, but reducing it is not sufficient evidence that the page is faster.

Look for repeated relationship queries

A possible pattern is a list of orders that loads each customer's details separately. In a simple hypothetical implementation with 30 orders, one query for the list and one per customer could mean 31 queries. The count is an illustration of the pattern, not a measurement from a client project.

Laravel's eager loading documentation explains how fetching required relationships with the parent results can address this N+1 query problem. I would check the controller, view and serialization path to see where related data is accessed.

That does not mean loading every available relationship. The repair should fetch what the page needs within the right account and permission scope. For summary counts, Eloquent also provides methods such as withCount so the application does not have to load every related model just to count it.

Which screen is slowing your team down?Tell me the task, who it affects and when the delay happens. I can review the performance problem and scope a fix around the evidence.
Talk to Adam about your Laravel app

Check how much data the dashboard asks for

I would separate the visible list from its summary panels and background requests. Does a list showing a few rows still calculate totals over the entire history? Does every filter change reload unrelated panels? Are large fields included in the response when the page only displays a name and status?

The SQL query itself may need investigation too. I would inspect the filters, joins, sorting and execution plan before proposing an index. An index should support an observed access pattern; I would also consider its effect on writes and the deployment needed to add it.

Laravel's pagination guidance explains that paginate calculates the total matching records, while simplePaginate can avoid that count when only previous and next navigation is required. Cursor pagination is another option for suitable ordered datasets, with requirements and navigation limitations.

I would choose around how staff actually use the screen. Removing page numbers or changing the default date range may make a request lighter, but those are product decisions to agree with the people using it.

Give cached information an explicit freshness rule

If a summary is repeatedly expensive to calculate, I would ask how current it must be. Yesterday's sales total and the stock available for an immediate allocation may have different requirements. A cache needs an agreed expiry or invalidation rule and a clear way to handle stale information.

I would also test account boundaries. A cached response intended for one customer or permission level must not become another user's dashboard. The performance change has to keep those access rules intact.

For expensive exports, the workflow may need a separate background job and download process. My guide to Laravel reports and CSV exports timing out covers that distinct problem.

Verify the fix with the same workflow

I would record a baseline, apply a focused change and repeat the same test with comparable data and conditions. The result should include the time until the screen is usable, database work, response size and any relevant resource usage. Warm and cold cache results should be labelled so the comparison is meaningful.

I would check behaviour as well as timing:

  • Filters, sorting and navigation still return the expected records.
  • Each user sees only the information their role and account permit.
  • Totals remain consistent with the agreed definitions.
  • Creating or changing a record updates the screen as expected.
  • The busiest realistic workflow still works after deployment.

If measurements show server capacity or contention is the limiting factor, I would include that in the recommendation. The outcome of the review should explain the proposed change, its expected benefit and how to verify it.

Get help with a slow or inherited Laravel application

My Laravel development and ongoing support work includes performance improvements, internal dashboards and inherited applications. I can investigate an agreed area, propose a scoped repair and discuss continuing support where the system needs regular attention.

Send a brief outline of what the application does, the slow task and any recent changes. Existing documentation is useful, but it is not a prerequisite for an initial conversation. The development and support pricing page explains focused audits and project work, with scope and cost agreed before work starts.

Make the daily workflow easier to use.Describe the screen that holds up your team. I will help identify the right next step for your application.
Discuss Laravel performance supportSee audit and project pricing

Need a hand with this?

Work directly with me on an existing Laravel application, from a focused assessment to ongoing development.

Talk directly to Adam

Share this article

Back to Blog