coringawc/filament-single-record-resource
Filament resource pattern that replaces list pages with a single resolved record per user, ideal for My Profile, My Wallet, or My Settings pages. Redirects index navigation to view, supports nested resources, and works with Filament 4 and 5.
view) is a UX decision, not just a technical one. Adoption locks in a "one destination per concept" navigation model — cleaner sidebar, fewer dead-end list screens for the 1:1 case.viewAny()-denied-but-view()-allowed fallback forces a deliberate policy decision: "can this user list all records?" is now separable from "can this user see their own record?" This is the correct security posture for per-user data and is worth adopting as a house convention.Strong fit:
belongsTo(User) relation (User hasOne Wallet, hasOne Profile).viewAny) but should allow opening the user's own record (view) — the authorization fallback is the main non-obvious value here.firstOrCreate, where('active', true), tenant scoping) while keeping authorization and page loading aligned.Look elsewhere or build in-house:
^4.0 || ^5.0.Adoption guardrails if you proceed: pin the version, write a policy test for the viewAny/view fallback, and add a scoping test for every nested route. The code surface is two traits and one interface, so a fork-and-own contingency is cheap and should be the stated fallback.
To executives (30 seconds). This is a small open-source component that lets us build standard account pages — My Profile, My Wallet, My Settings, Current Subscription — with a fraction of the custom code we would otherwise write. It is MIT-licensed, free, and about two files' worth of logic, so it carries almost no lock-in: if it ever stops working for us, we can absorb it internally in days. It accelerates features already on the roadmap; it does not add scope.
To engineering. Filament 4/5 plugin, two traits (HasSingleRecordResource on the Resource, HasSingleRecord on ViewRecord/EditRecord) plus an explicit SingleRecordResolvableResource contract for static-analysis-friendly typing. It solves the real friction in the single-record pattern: index redirect, nav registration without an index, root record resolution, the viewAny-denied-but-view-allowed authorization fallback, and breadcrumb/slug normalization in nested chains. Resolution is overridable at the Resource level (builder or full resolver) so tenant logic and firstOrCreate stay in one place, keeping authorization and page loading aligned. It ships with Pest, PHPStan, and Pint in CI across Filament 4 and 5.
To product/design. One predictable destination per concept instead of a list view of one item. Users lands directly on their record, edit in place, with correct breadcrumbs through nested pages. Sidebar entries are stable and don't dead-end.
The honest caveats to state up front. Twelve stars, zero dependents, a single maintainer, and pre-2.0 versioning — this is not a mature dependency. Mitigate with a pinned version, tests around authorization and nested scoping, and a one-sprint fork contingency. It is a convenience we can afford to lose, which is exactly why the risk is acceptable.
How can I help you explore Laravel packages today?