About Services Work Security Process Code Notes Start a project
Custom WordPress Theme 2026

Hermeticdental

A subscription-billing SaaS built from scratch on Laravel — role-based access, a queue-driven PDF pipeline, and Stripe integration handling thousands of invoices a day.

Client
Logistics SaaS (NDA)
Role
Sole developer & architect
Timeline
14 weeks · 2026
Stack
Laravel 11LivewireStripeRedisMySQL
app.example.com
Invoices+ New invoice
Collected (MTD)
$284k▲ 12%
Outstanding
$31k
Invoices sent
2,418
INV-20413$1,200
INV-20412$840
INV-20411DUE$2,100
INV-20410$560
2,400+
Invoices processed every day without a hitch
120ms
Median API response under production load
0
Double-charges since launch — race-safe by design
99.98%
Uptime across the first six months live
Overview

A billing engine the team could actually trust

The client was running their subscription billing on a tangle of spreadsheets and a third-party tool that didn't fit their multi-tenant model. They needed a platform of their own — one that could issue thousands of invoices a day, never double-charge a customer, and be hardened enough to hold sensitive financial data.

I designed and built it solo on Laravel 11: a clean, tested codebase with role-based access, a queue-driven PDF pipeline, and a Stripe integration that reconciles itself. No starter kit shortcuts, no plugin soup — every layer was written to be understood and maintained.

The challenge

What was breaking

The old setup couldn't keep up — and every edge case cost the team real money and trust.

  • Concurrent requests occasionally double-charged customers
  • PDF generation blocked the request and timed out at scale
  • No tenant isolation — a real risk for financial data

How I solved it

Each problem mapped to a deliberate, testable architectural decision.

  • Race-safe reservations via DB transactions & row locks
  • PDFs moved to a queued job with Redis & retry logic
  • Tenant scoping enforced globally at the model layer
Code highlight

Race-safe charging, by design

The core fix: wrap the charge in a database transaction with a row lock so two concurrent requests can never bill the same invoice twice. Simple, boring, and bulletproof.

app/Services/ChargeService.php
public function charge( Invoice $invoice ): Payment
{
    return DB::transaction( function () use ( $invoice ) {
        // Lock the row so concurrent requests wait their turn
        $invoice = Invoice::lockForUpdate()->find( $invoice->id );

        if ( $invoice->isPaid() ) {
            throw new AlreadyPaidException();
        }

        $payment = $this->gateway->capture( $invoice );
        $invoice->markPaid( $payment );

        return $payment;
    } );
}
What I built

Key features

Subscription engine

Plans, proration, trials, and dunning — reconciled automatically against Stripe webhooks.

Queue-driven PDFs

Invoices render in a background job with retries, so the UI never blocks or times out.

Role-based access

Granular permissions and tenant isolation enforced at the model layer, not the view.

Hardened & audited

2FA, signed webhooks, encrypted secrets, and a full security header set out of the box.

“
Our Laravel dashboard handles thousands of bookings a day without a hitch. The architecture is clean and the handover docs were genuinely excellent.
DK
David K.
CTO, Logistics SaaS

Have a project that needs building right?

Tell me what you're building. I'll reply within one business day with an honest plan and a fixed quote — secure payment via PayPal or crypto.