PHPackages                             sevendays-digital/filament-nested-resources - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. sevendays-digital/filament-nested-resources

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

sevendays-digital/filament-nested-resources
===========================================

Helpers to work with nested resources

214.5k↓77.9%8[8 issues](https://github.com/Sevendays-Digital/filament-nested-resources/issues)[6 PRs](https://github.com/Sevendays-Digital/filament-nested-resources/pulls)PHP

Since May 29Pushed 2y ago1 watchersCompare

[ Source](https://github.com/Sevendays-Digital/filament-nested-resources)[ Packagist](https://packagist.org/packages/sevendays-digital/filament-nested-resources)[ RSS](/packages/sevendays-digital-filament-nested-resources/feed)WikiDiscussions main Synced 3d ago

READMEChangelogDependenciesVersions (4)Used By (0)

Helpers to work with nested resources
=====================================

[](#helpers-to-work-with-nested-resources)

This package adds support for nested resources in Filament.

It provides the base classes and column to provide the nested structure.

It currently is not that configurable and you need to follow naming conventions usually used by Laravel.

Demo:

    Screen.Recording.2023-04-07.at.13.14.05.mov    Installation
------------

[](#installation)

You can install the package via composer:

```
composer require sevendays-digital/filament-nested-resources
```

Usage
-----

[](#usage)

Currently you need to do a couple of changes to make this work. But you start of by creating a [filament resource](https://filamentphp.com/docs/2.x/admin/resources/getting-started#creating-a-resource)(The parent resource should already exist at this point. The resource we are changing is the child one).

Once you have that, you will need to change the `Filament/Resources/ChildModelResource.php` to the `NestedResource`.

```
use SevendaysDigital\FilamentNestedResources\Columns\ChildResourceLink;
use SevendaysDigital\FilamentNestedResources\NestedResource;

class ChildModelResource extends NestedResource
{
    public static function getParent(): string
    {
        return ParentModelResource::class;
    }
}
```

Then for each of the resource pages, you need to add the trait:

```
use SevendaysDigital\FilamentNestedResources\ResourcePages\NestedPage;
```

Finally, on your `ParentModelResource` you can add the column to provide the links:

```
public static function table(Table $table): Table
{
    return $table
        ->columns([
            ChildResourceLink::make(ChildModelResource::class),
        ]);
}
```

### Accessing the parent

[](#accessing-the-parent)

When you need the parent in livewire context such as the form, you can add the second argument to your form method:

```
public static function form(Form $form, ?Event $parent = null): Form;
```

Where `Event` is the model that should be the parent.

### Sidebar

[](#sidebar)

By default when in a "context" the sidebar will register the menu item for that resource.

So if you are inside a Project which has documents, the sidebar will show documents when you are on a project or deeper level.

If you do not want this, you can set `shouldRegisterNavigationWhenInContext` to false in the child resource.

### Notes

[](#notes)

You cannot use a child resource for multiple parents, however, you can can have multiple resources pointing to the same model.

Just make sure you set a custom slug for the resources so that it builds unique routes.

Testing
-------

[](#testing)

There's none :).

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Harings Rob](https://github.com/Sevendays-Digital)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance12

Infrequent updates — may be unmaintained

Popularity33

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity27

Early-stage or recently created project

 Bus Factor1

Top contributor holds 84.4% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/0620f4b2365909cf6bdc86788a35689579dbd59e1ba51a86c839c2da321ab90e?d=identicon)[harings\_rob](/maintainers/harings_rob)

---

Top Contributors

[![haringsrob](https://avatars.githubusercontent.com/u/866743?v=4)](https://github.com/haringsrob "haringsrob (38 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (3 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (3 commits)")[![mstfkhazaal](https://avatars.githubusercontent.com/u/47450090?v=4)](https://github.com/mstfkhazaal "mstfkhazaal (1 commits)")

### Embed Badge

![Health badge](/badges/sevendays-digital-filament-nested-resources/health.svg)

```
[![Health](https://phpackages.com/badges/sevendays-digital-filament-nested-resources/health.svg)](https://phpackages.com/packages/sevendays-digital-filament-nested-resources)
```

###  Alternatives

[pixeloution/true-random

Interface for getting random datra from random.org

441.3k](/packages/pixeloution-true-random)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
