PHPackages                             coringawc/filament-single-record-resource - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Admin Panels](/categories/admin)
4. /
5. coringawc/filament-single-record-resource

ActiveLibrary[Admin Panels](/categories/admin)

coringawc/filament-single-record-resource
=========================================

A Filament plugin that solves the single-record resource pattern — resources that display exactly one record per authenticated user (e.g. 'My Profile', 'My Wallet', 'My Settings') without an index page, and their arbitrarily nested child resources.

v1.1.1(2mo ago)116121MITPHPPHP ^8.2CI passing

Since Mar 12Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/CoringaWc/filament-single-record-resource)[ Packagist](https://packagist.org/packages/coringawc/filament-single-record-resource)[ Docs](https://github.com/coringawc/filament-single-record-resource)[ GitHub Sponsors](https://github.com/CoringaWc)[ RSS](/packages/coringawc-filament-single-record-resource/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (7)Dependencies (25)Versions (8)Used By (0)

Filament Single Record Resource
===============================

[](#filament-single-record-resource)

[![Latest Version on Packagist](https://camo.githubusercontent.com/e17d44b417f39182acb7962b2a4d287a34d05c5c9c036e3c09a89b3c6b40bff4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f636f72696e676177632f66696c616d656e742d73696e676c652d7265636f72642d7265736f757263652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/coringawc/filament-single-record-resource)[![GitHub Tests Action Status](https://camo.githubusercontent.com/1604fa7a8e0b6d24f20f1a9f02ef3279496ee9ba45ae766d6886bdd3b3150ea5/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f636f72696e676177632f66696c616d656e742d73696e676c652d7265636f72642d7265736f757263652f72756e2d74657374732e796d6c3f6272616e63683d352e78266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/coringawc/filament-single-record-resource/actions?query=workflow%3Arun-tests+branch%3A5.x)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/8b47bf0811f2fa542fbe3abdfd15fdffeddefaff9ee76573106be40ae18f6c88/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f636f72696e676177632f66696c616d656e742d73696e676c652d7265636f72642d7265736f757263652f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d352e78266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/coringawc/filament-single-record-resource/actions?query=workflow%3A%22Fix+PHP+code+styling%22+branch%3A5.x)[![Total Downloads](https://camo.githubusercontent.com/32cb3235f07c13af6338f19456c066c3bf2f39a2567f77885563d7b888220cc0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f636f72696e676177632f66696c616d656e742d73696e676c652d7265636f72642d7265736f757263652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/coringawc/filament-single-record-resource)

This package implements the single-record resource pattern for Filament panels.

Instead of a list page (`index`) with many records, you open one resource that always resolves to one business record per authenticated user.

Common examples:

- My Profile
- My Wallet
- My Settings
- Current Subscription

Compatibility
-------------

[](#compatibility)

- Filament `^4.0 || ^5.0`
- Laravel versions supported by the selected Filament major

Installation
------------

[](#installation)

```
composer require coringawc/filament-single-record-resource
```

Core Concepts
-------------

[](#core-concepts)

This package is based on two traits:

It also exposes an explicit contract interface, `SingleRecordResolvableResource`, for Resources that want first-class static-analysis support.

1. `HasSingleRecordResource` (Resource trait)

- Redirects index/navigation behavior to `view`
- Keeps sidebar navigation working without an `index` page
- Falls back to `view` authorization on the resolved record when `viewAny` is denied
- Exposes shared record resolution hooks on the Resource
- Helps nested resources resolve root URLs/slugs in single-record chains

2. `HasSingleRecord` (Page trait for `ViewRecord` and `EditRecord`)

- Resolves the root single record automatically
- Supports custom resolution via builder or custom resolver method
- Prefers the Resource contract when available, while remaining compatible with legacy Resources that expose the same methods manually
- Normalizes breadcrumbs in deep nested resources

Step-by-Step Implementation
---------------------------

[](#step-by-step-implementation)

### 1. Create your resource as single-record root

[](#1-create-your-resource-as-single-record-root)

In your Filament Resource, use `HasSingleRecordResource` and register only `view` (and optionally `edit`) pages.

```
