TL;DR
- Public Livewire tables package: extracted a theme-class seam so Blades stop branching per theme (full write-up in a separate post).
- Analytics dashboard: fixed timezone-bucketed charts and exact request counts past Elasticsearch's 10k cap.
- Identity sync: nailed an Active Directory password-set gotcha that needed a model re-fetch.
- Membership platform: shipped white-label branding driven by settings.
Four threads today, one public, three anonymized.
1. Public: a theme-class seam for Livewire tables
The big one. Blade partials that branched @if($isTailwind)/@elseif($isBootstrap) for CSS classes don't scale when you add a third theme. I pulled all class strings into one static, cache-safe map and gave Blades a single themeClasses('key') accessor — new themes override keys instead of re-implementing templates, guarded by characterization tests. Repo: cleaniquecoders/laravel-livewire-tables. Separate focused post covers it.
2. Analytics dashboard: timezone and count correctness
Two subtle reporting bugs, both generic enough to be worth naming.
Peak-hours bucketing. Hourly charts bucketed on raw UTC, so "peak hour" was off by the app's offset. Fix: bucket by the application timezone at the metrics-provider layer, not in the app on top of a UTC result.
The 10k ceiling. Elasticsearch caps hits.total at 10,000 by default, so "Total Requests" plateaued and error-rate math went wrong on busy days. The fix is one flag:
// exact totals instead of the lower-bound 10k estimate
$params['body']['track_total_hits'] = true;
| Bug | Root cause | Fix |
|---|---|---|
| Wrong peak hour | Bucketed on UTC | Bucket on app timezone |
| Requests capped at 10k | ES default track_total_hits
|
Set it to true
|
| Chart drill-down 500 |
array_sum over mixed shape |
Normalize series first |
Also settled the timezone at the package level and dropped the per-app override — the fix belongs where the data is shaped, not patched downstream.
3. Identity sync: the AD password gotcha
Syncing users into Active Directory, setting the password threw unicodePwd: No such attribute. Cause: the directory model was stale between create and the password write. Fix: re-fetch the model right before setting the password so the write targets a live object. Wrote it up as a support note because it's the kind of thing you rediscover painfully six months later.
Also moved pending-sync reconciliation to be source-of-truth-first: reconcile against the authoritative HR system before touching the directory, so orphaned attempts heal instead of pile up.
4. Membership platform: white-label branding
Footer credit, contact email, and brand colours are now settings-driven instead of hardcoded, so one codebase can present as different brands. Standard move: a typed settings object, a config fallback, and a Blade partial reading from it.
Thread of the day
Correctness in the boring layer. Three of four items were "the code ran fine and returned the wrong thing" — a timezone offset, a silent 10k cap, a stale directory model. None throw. All caught by asking whether the number is actually true.
Top comments (0)