PHPackages                             nckrtl/filament-resource-templates - 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. nckrtl/filament-resource-templates

ActiveLibrary[Admin Panels](/categories/admin)

nckrtl/filament-resource-templates
==================================

This is my package filament-resource-templates

0.2(1y ago)0113[5 PRs](https://github.com/nckrtl/filament-resource-templates/pulls)MITPHPPHP ^8.4CI passing

Since May 19Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/nckrtl/filament-resource-templates)[ Packagist](https://packagist.org/packages/nckrtl/filament-resource-templates)[ Docs](https://github.com/nckrtl/filament-resource-templates)[ GitHub Sponsors]()[ RSS](/packages/nckrtl-filament-resource-templates/feed)WikiDiscussions main Synced yesterday

READMEChangelog (2)Dependencies (14)Versions (9)Used By (0)

Filament Resource Templates
===========================

[](#filament-resource-templates)

[![Latest Version on Packagist](https://camo.githubusercontent.com/5e0260ebee954f7408c0bb54fad134804523dcac6ad254c652e7612be6c4edd5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6e636b72746c2f66696c616d656e742d7265736f757263652d74656d706c617465732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/nckrtl/filament-resource-templates)[![GitHub Tests Action Status](https://camo.githubusercontent.com/daf75bdfd2919204d2f67a62958d5c11ffd5cd3d438ca0363901b4c500a52e8d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6e636b72746c2f66696c616d656e742d7265736f757263652d74656d706c617465732f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/nckrtl/filament-resource-templates/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/550e87edc2c6c6dd4e75f5f178e25520e00edd555d8a86d7b8375001eca61e33/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6e636b72746c2f66696c616d656e742d7265736f757263652d74656d706c617465732f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/nckrtl/filament-resource-templates/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/4085ab1e24b745e505ca55ce1b0eb0886ef500c565b729d1affa33c2bf6705ba/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6e636b72746c2f66696c616d656e742d7265736f757263652d74656d706c617465732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/nckrtl/filament-resource-templates)

This package allows you to add the concept of templates to your Filament Resources. By utilizing DTO's to define template sections and components we can apply more structure which is useful when we need to display the content in the frontend through auto completion. This is as well beneficial for Livewire frontends as for Inertia frontends that use typescript.

Use with cause
--------------

[](#use-with-cause)

This package is still considered a work in progress. There are no tests yet and things are still likely to change. So use with caution as future changes might result in data loss when editing records in filament using the template feature of this package.

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

[](#installation)

You can install the package via composer:

```
composer require nckrtl/filament-resource-templates
```

Usage
-----

[](#usage)

1. Prepare your models and tables Each resource you want to use templates for needs at least a template column that can contain a string (`$table->string('template')`) and content column that will contain the structered content in json format (`$table->json('content')`). By default all data of your template will be stored in the content column, but if you need data that needs to sit in their own column that's also possible.

In the example below we'll use pages as an example and we'll store the title and slug in a separate column so we can display it more easily in the table on the resource list page.

2. Create a template file. A template file is basically just a DTO:

```
namespace App\Filament\Resources\PageResource\Pages\Default;

use App\Filament\Resources\PageResource\Pages\Partials\Sections\TextSectionData;
use Filament\Forms\Components\Grid;
use Filament\Forms\Components\Tabs;
use Filament\Forms\Components\Tabs\Tab;
use Filament\Forms\Components\TextInput;
use NckRtl\FilamentResourceTemplates\Template;

class DefaultTemplate extends Template
{
    const NAME = 'Default';

    public string $title;

    public string $slug;

    public static function form()
    {
        return Tabs::make('Label')
            ->tabs([
                Tab::make('General')
                    ->schema([
                        Grid::make(2)->schema([
                            TextInput::make('title')
                                ->placeholder('Titel')
                                ->label('Titel'),
                            TextInput::make('slug')
                                ->placeholder('slug')
                                ->prefix(config('app.url').'/')
                                ->label('slug'),
                        ]),
                    ]),
            ]);
    }
}
```

Each template at least should have a name and a form definition. In addition you can add sections and properties. When you add class properties that are used in the form definition, then those properties will be stored in their own column. So make sure the columns are added to the table beforehand.

3. Add sections The form definition in the template is the first section being displayed. You can add additional sections by defining them with a const:

```
const SECTIONS = [
    TextSectionData::SECTION_KEY => TextSectionData::class,
];
```

This section is a separate DTO that may look like:

```
namespace App\Filament\Resources\PageResource\Pages\Partials\Sections;

use Filament\Forms\Components\RichEditor;
use Filament\Forms\Components\Section;
use NckRtl\FilamentResourceTemplates\TemplateSection;

class TextSectionData extends TemplateSection
{
    const SECTION_KEY = 'text';

    public ?string $text = '';

    public static function form()
    {
        return Section::make('Content')->schema(
            [
                RichEditor::make(static::key('text'))
            ]);
    }
}
```

4. Update the class to extend TemplateResource

```
use NckRtl\FilamentResourceTemplates\TemplateResource;

class PageResource extends TemplateResource
...
```

5. Define a list of templates:

```
public static function getTemplateClasses(): Collection
{
    return collect([
        DefaultTemplate::class,
        ...
    ]);
}
```

6. Now when you create a record you should see the template dropdown and the first template will be selected, while showing the form definition defined in the template.

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

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

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

[](#contributing)

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

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

[](#security-vulnerabilities)

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

Credits
-------

[](#credits)

- [Nick Retel](https://github.com/nckrtl)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance67

Regular maintenance activity

Popularity10

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 70.7% 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.

###  Release Activity

Cadence

Every ~326 days

Total

2

Last Release

449d ago

PHP version history (2 changes)0.1PHP ^8.2

0.2PHP ^8.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/9d5702c35fc18764615b1a80dffdcd4a980a04fd79bc2192bc7db79691ae0447?d=identicon)[nckrtl](/maintainers/nckrtl)

---

Top Contributors

[![nckrtl](https://avatars.githubusercontent.com/u/18613261?v=4)](https://github.com/nckrtl "nckrtl (29 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (6 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (6 commits)")

---

Tags

laravelNick Retelfilament-resource-templates

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/nckrtl-filament-resource-templates/health.svg)

```
[![Health](https://phpackages.com/badges/nckrtl-filament-resource-templates/health.svg)](https://phpackages.com/packages/nckrtl-filament-resource-templates)
```

###  Alternatives

[relaticle/custom-fields

User Defined Custom Fields for Laravel Filament

16354.2k](/packages/relaticle-custom-fields)[rawilk/profile-filament-plugin

Profile &amp; MFA starter kit for filament.

3914.6k](/packages/rawilk-profile-filament-plugin)[stephenjude/filament-debugger

About

104162.2k2](/packages/stephenjude-filament-debugger)[marcelweidum/filament-passkeys

Use passkeys in your filamentphp app

6649.5k1](/packages/marcelweidum-filament-passkeys)[mradder/filament-logger

Audit logging, activity tracking, exports, alerts, and dashboards for Filament admin panels.

2317.1k](/packages/mradder-filament-logger)[a2insights/filament-saas

Filament Saas for A2Insights

171.7k](/packages/a2insights-filament-saas)

PHPackages © 2026

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