Designing a Laravel Logistics Dashboard for Daily Operations
Design shipment workflows, integer-based invoicing, authorised status transitions, courier integrations, and operational reports that staff can trust.
Md Shafin Ahmed
Full-Stack Developer
An operations dashboard should answer what needs attention, who can act, and what changed since the previous shift. This design case study is illustrative, not a disclosure of client code or measured client outcomes. Just Jeans BD involves inventory, Pathao, and Meta Pixel work; those real project areas provide context for discussing order handoffs without inventing logistics performance claims.
1. Observe the work before arranging widgets
Map an order from confirmation through stock allocation, packing, courier handover, delivery, and reconciliation. Ask what staff do when an address is incomplete or a delivery attempt fails. Record the evidence needed at each handoff, including who changed the state. A dashboard built around exceptional work is usually more useful than a wall of totals.
Define separate concepts for an order, shipment, package, invoice, payment, and return. One order might produce several shipments, and a returned package does not necessarily mean the invoice disappears. Write a glossary with operations and accounting stakeholders. Use sample scenarios to settle these differences before building database relationships that accidentally assume every order follows the simplest happy path.

2. Treat shipment status as a controlled transition
Define allowed transitions rather than accepting any status string from a dropdown. Moving from packed to dispatched may require a tracking reference; moving from dispatched to delivered may require trusted courier evidence or a documented manual override. Maintain append-only status events alongside the current status so staff can reconstruct what happened.
The fragment below belongs in an authenticated controller with a registered shipment policy. It illustrates an operator-controlled dispatch transition, not a courier webhook. It assumes a status-events relationship and uses a transaction so the state and history move together. Add your branch permissions, tracking validation, and audit retention rules. Never accept an actor identifier or branch ownership from the request body.
use App\Models\Shipment;
use Illuminate\Support\Facades\DB;
$this->authorize('dispatch', $shipment);
$data = $request->validate([
'tracking_reference' => ['required', 'string', 'max:100'],
]);
$actorId = $request->user()->id;
DB::transaction(function () use ($shipment, $data, $actorId) {
$locked = Shipment::whereKey($shipment->id)->lockForUpdate()->firstOrFail();
abort_unless($locked->status === 'packed', 409);
$locked->status = 'dispatched';
$locked->tracking_reference = $data['tracking_reference'];
$locked->save();
$locked->statusEvents()->create([
'from_status' => 'packed',
'to_status' => 'dispatched',
'actor_id' => $actorId,
]);
});3. Make inventory reservations explicit
Separate on-hand stock, reserved stock, and available stock. Decide when reservations begin and when they expire. A pending payment may reserve inventory for a limited period, while a confirmed order might hold it until packing. Use database transactions and appropriate row locking when competing orders can reserve the same final unit.
Record inventory movements with a reason and a related business record rather than repeatedly editing a total without history. Returns should enter an inspection state before becoming sellable again. Use a unique reference for each external event so retries cannot subtract stock twice. Review negative-stock exceptions daily, and provide a controlled correction workflow instead of giving every staff account unrestricted quantity editing.
4. Store monetary values as integer minor units
Keep amounts in the currency's smallest supported accounting unit, together with an explicit currency code. Do not calculate invoice totals with binary floating-point values. Define discount ordering, tax rounding, shipping charges, and refund allocation with accounting stakeholders. Currency conversion requires a separately documented rate and rounding policy; an integer amount alone does not solve foreign-exchange rules.
This helper demonstrates a bounded line total using integer inputs. It deliberately excludes tax and discounts, which need their own tested rules. Validate imported values before calling it, and ensure your deployment uses a suitable integer range. Format the result for display only at the presentation boundary; never parse a decorated currency string back into the source of truth.
function lineTotalMinor(int $unitPriceMinor, int $quantity): int
{
if ($unitPriceMinor < 0 || $quantity < 1 || $quantity > 10000) {
throw new InvalidArgumentException('Invalid line item.');
}
if ($unitPriceMinor > intdiv(PHP_INT_MAX, $quantity)) {
throw new OverflowException('Line total exceeds integer capacity.');
}
return $unitPriceMinor * $quantity;
}
$totalMinor = lineTotalMinor(125050, 2);
// 250100 minor units; currency and rounding policy are stored separately.5. Build courier integrations around retries
Create a durable dispatch request locally before contacting a courier. Attach an idempotency reference where the provider supports it, and record request state without storing credentials in logs. A timeout does not prove that the courier rejected the shipment. Reconcile uncertain requests with the provider before creating a replacement that might duplicate the booking.
For incoming events, follow the provider's documented authentication or signature mechanism, validate payloads, and deduplicate event identifiers. Do not invent a signature header and assume it matches Pathao or another provider. Map external statuses into your own state model deliberately. Out-of-order events should not move a delivered shipment back into transit simply because an older webhook arrived late.

6. Separate staff workspaces and permissions
Give warehouse staff packing information, accountants financial reconciliation, and managers cross-team exceptions. A single overloaded table encourages accidental edits and makes sensitive data harder to protect. Authorise each shipment, invoice, attachment, and export with policies. Scope list queries to the user's branch or organisation rather than fetching everything and hiding rows in the interface.
Design bulk actions carefully. Show exactly which records are eligible, require confirmation for consequential changes, and recheck permissions on the server. Keep customer addresses out of broad analytics exports unless required. Paginate operational tables, preserve filters after updates, and display the last refresh time so staff know whether they are acting on a current view.
7. Choose reports that lead to action
Start with undelivered shipments by age, orders blocked by stock, courier booking failures, and invoices awaiting reconciliation. Define every metric in plain language, including its timezone and excluded states. A delivered count and a settled-payment count answer different questions. Do not combine them into a revenue figure without explaining recognition rules.
Build reports from indexed date, status, and ownership fields, and inspect representative queries before adding caching. Cached figures need a visible freshness rule. Generate large exports asynchronously and protect the resulting download with authorisation. For marketing analytics such as Meta Pixel, avoid sending sensitive operational or personal data and respect the applicable consent requirements rather than treating tracking as an accounting ledger.
8. Rehearse a full operational day
Test a normal order, a split shipment, a failed booking, a duplicate webhook, a return, and a manual correction. Include two staff members changing the same shipment concurrently. Reconcile stock movements and invoice totals at the end of the rehearsal. Assign an owner to unresolved exceptions so the dashboard does not become a passive list of problems.
- Verify status history and actor attribution.
- Test inventory under competing reservations.
- Reconcile integer totals with accounting rules.
- Check branch isolation and export permissions.
- Document courier retry and recovery procedures.
Written by
Md Shafin Ahmed
Laravel, Wix & Flutter developer at HEXBRID, building custom web applications, e-commerce stores, and mobile apps for growing businesses.
More About Me