PHPackages                             ribeiroconde/filament-dictionary - 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. ribeiroconde/filament-dictionary

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

ribeiroconde/filament-dictionary
================================

A step-by-step wizard to generate full Eloquent and Filament resources straight from the Filament panel

v1.0.1(3w ago)03↓100%MITPHPPHP ^8.3

Since May 14Pushed 3w agoCompare

[ Source](https://github.com/ribeiroconde/dictionary)[ Packagist](https://packagist.org/packages/ribeiroconde/filament-dictionary)[ Docs](https://github.com/ribeiroconde/filament-dictionary)[ RSS](/packages/ribeiroconde-filament-dictionary/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (2)Dependencies (10)Versions (3)Used By (0)

Filament Dictionary
===================

[](#filament-dictionary)

A powerful [Filament](https://filamentphp.com) plugin that enables rapid scaffolding and generation of Eloquent models, migrations, factories, seeders, and Filament resources through an intuitive wizard interface.

[![Latest Version on Packagist](https://camo.githubusercontent.com/7d3e5d381bf1e23c571a342182515019b03806238d9985f39bbd99f651611c22/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7269626569726f636f6e64652f66696c616d656e742d64696374696f6e6172792e737667)](https://packagist.org/packages/ribeiroconde/filament-dictionary)[![GitHub Tests](https://camo.githubusercontent.com/ec9dc1b5da78c6d6a5d1f6b8a0a21525670edd0816bbe2f6e3daf16a91a3ac46/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f7269626569726f636f6e64652f66696c616d656e742d64696374696f6e6172792f74657374732e796d6c3f6c6162656c3d5465737473)](https://github.com/ribeiroconde/filament-dictionary/actions)[![Total Downloads](https://camo.githubusercontent.com/0f9f0eacc9e1e8f66fdae164815674e7bc64f7a8cd2c564a440afb6796dfad29/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7269626569726f636f6e64652f66696c616d656e742d64696374696f6e6172792e737667)](https://packagist.org/packages/ribeiroconde/filament-dictionary)[![License](https://camo.githubusercontent.com/5846d0f8b321034ca8976721b68c815c17794b59f9f90fc492d0af4dd5dd44ed/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f7269626569726f636f6e64652f66696c616d656e742d64696374696f6e6172792e737667)](https://packagist.org/packages/ribeiroconde/filament-dictionary)[![Live Demo](https://camo.githubusercontent.com/90ffd28f6a69bce57a878f38ec0a297c9a36de6eb08365d14aa12129df3f5ba1/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6976655f44656d6f2d64696374696f6e6172792e66696c616d656e74636f6d706f6e656e74732e636f6d2d626c7565)](https://dictionary.filamentcomponents.com/)

[![Dictionary](https://private-user-images.githubusercontent.com/7920412/577085674-a49a605b-0d33-4321-aa92-114e8b96f9d5.jpeg?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3ODA1MjA5OTEsIm5iZiI6MTc4MDUyMDY5MSwicGF0aCI6Ii83OTIwNDEyLzU3NzA4NTY3NC1hNDlhNjA1Yi0wZDMzLTQzMjEtYWE5Mi0xMTRlOGI5NmY5ZDUuanBlZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjA2MDMlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYwNjAzVDIxMDQ1MVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTYyMzhiNjQyZWNhYWEzYTYwMjI5ZTUyYzgxNjZjNDQxODViZWQwNjEyMzk3MzRmNGI3OTRkNDU1MTNhMWE0MjYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JnJlc3BvbnNlLWNvbnRlbnQtdHlwZT1pbWFnZSUyRmpwZWcifQ.g3N_oFb_KrGo031ov79OeLcKnFcDkA0IWdrgoRAtd_g)](https://private-user-images.githubusercontent.com/7920412/577085674-a49a605b-0d33-4321-aa92-114e8b96f9d5.jpeg?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3ODA1MjA5OTEsIm5iZiI6MTc4MDUyMDY5MSwicGF0aCI6Ii83OTIwNDEyLzU3NzA4NTY3NC1hNDlhNjA1Yi0wZDMzLTQzMjEtYWE5Mi0xMTRlOGI5NmY5ZDUuanBlZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjA2MDMlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYwNjAzVDIxMDQ1MVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTYyMzhiNjQyZWNhYWEzYTYwMjI5ZTUyYzgxNjZjNDQxODViZWQwNjEyMzk3MzRmNGI3OTRkNDU1MTNhMWE0MjYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JnJlc3BvbnNlLWNvbnRlbnQtdHlwZT1pbWFnZSUyRmpwZWcifQ.g3N_oFb_KrGo031ov79OeLcKnFcDkA0IWdrgoRAtd_g)

Tip

**Try the live demo** — [dictionary.filamentcomponents.com](https://dictionary.filamentcomponents.com/)

Important

**Upgrading from `v0.2.x` or earlier?** `v1.0.0` introduces new database migrations.

```
composer require ribeiroconde/filament-dictionary:^1.0
php artisan dictionary:upgrade
```

See [`UPGRADE.md`](UPGRADE.md) for the full upgrade steps.

It gives you a wizard for defining a table schema, then generates and updates the matching:

- Eloquent model
- migration
- factory
- seeder
- Filament resource and page classes

The current implementation is built for iterative work, not just first-time scaffolding. Existing blueprints can be created, merged, or replaced depending on the selected generation mode.

Quick Start
-----------

[](#quick-start)

> Prerequisite: you already have a Laravel app with a Filament panel set up.

> Upgrading from a pre-1.0.0 release? Skip to the [Upgrade](#upgrading-from-pre-100) section, or review [`UPGRADE.md`](UPGRADE.md).

1. Install the package.
2. Run the Dictionary installer.
3. Register the plugin in your Filament panel.
4. Open the **Dictionary** action in your panel and generate your first resource stack.

```
composer require ribeiroconde/filament-dictionary
php artisan dictionary:install
```

```
use ribeiroconde\Dictionary\DictionaryPlugin;

->plugins([
    DictionaryPlugin::make(),
])
```

---

Highlights
----------

[](#highlights)

### Wizard-driven scaffolding inside Filament

[](#wizard-driven-scaffolding-inside-filament)

- Multi-step wizard with database, Eloquent, and review steps
- Live previews for:
    - migration
    - model
    - factory
    - seeder
    - Filament resource
- Existing blueprints can be listed, loaded back into the wizard, and deleted

### Generates the full stack around a model

[](#generates-the-full-stack-around-a-model)

Dictionary can generate:

- Eloquent models
- create migrations
- sync/update migrations for existing tables
- model factories
- seeders
- Filament resources
- Filament `List`, `Create`, `Edit`, and `View` pages

### Three generation modes

[](#three-generation-modes)

When files already exist, you can choose how Dictionary behaves:

- `create` — only create missing blueprints
- `merge` — refresh managed/generated sections while preserving custom code where possible
- `replace` — rewrite generated blueprints and unlock destructive rebuild workflows

`merge` is the default and the safest mode for day-to-day iteration.

### Merge-aware updates for existing code

[](#merge-aware-updates-for-existing-code)

The plugin now updates existing generated files instead of blindly overwriting them.

For models, factories, and Filament resources, the merge flow is parser-aware and uses `nikic/php-parser` to preserve custom code while refreshing generated structure. Seeders use a managed generated-region strategy.

Current merge support includes:

- **Model**

    - merges missing imports
    - merges traits like `HasFactory`, `SoftDeletes`, `HasUuids`, `HasUlids`
    - updates `$fillable`
    - adds inferred `belongsTo` relationships for foreign-key-like columns
    - preserves existing custom methods
- **Factory**

    - merges missing `definition()` keys
    - preserves existing custom values
    - preserves custom methods/state helpers
- **Seeder**

    - merges only the managed generated seeding region
    - preserves custom logic outside that region
    - hides managed markers from preview output
- **Filament Resource**

    - **v3 (monolithic):** merges generated `form()`, `table()`, and `infolist()` sections; preserves custom entries; keeps missing page classes
    - **v4 (domain):** merges each schema/table file independently (`*Form.php`, `*Infolist.php`, `*Table.php`); thin resource only syncs imports and `getEloquentQuery()`
    - removes stale managed fields when columns are removed from the blueprint
    - preserves existing page classes; creates missing ones

### Revision-aware migration previews and sync generation

[](#revision-aware-migration-previews-and-sync-generation)

Dictionary stores blueprint revisions after successful generation.

That revision history is used to make migration previews and sync migrations smarter:

- migration preview compares the current blueprint against the **latest generated revision**, not only the live database state
- sync migration generation follows the same revision-aware diff baseline
- this avoids re-showing or re-generating fields that belonged to a previous revision but were not yet applied in the database

### Safer schema evolution

[](#safer-schema-evolution)

Dictionary supports guarded schema changes for existing tables:

- additive sync migrations for new columns
- column type / nullable / default / index / unique changes
- likely rename detection
- destructive change gating for removed columns
- soft delete add/remove handling
- optional immediate migration execution
- automatic warning/defer behavior when risky schema operations are not explicitly allowed

### Better generated-file readability

[](#better-generated-file-readability)

When enabled, Dictionary will try to run a formatter after writing generated files.

It also normalizes merged output for several blueprint types so updated files stay readable, including:

- multiline resource arrays and fluent chains
- spacing between class members in models and factories
- multiline factory `definition()` arrays

### Filament panel integration

[](#filament-panel-integration)

- Works with **Filament 4 and 5** (legacy `v3` flat structure also supported via `DICTIONARY_FILAMENT_VERSION=v3`)
- Generates resources in the correct structure for your Filament version (`v4`/`v5` domain by default, `v3` flat as legacy) — controlled by `DICTIONARY_FILAMENT_VERSION`
- Registers as a global panel action through the plugin
- Can render as a normal button or icon button
- Supports these render hooks:
    - `PanelsRenderHook::GLOBAL_SEARCH_BEFORE`
    - `PanelsRenderHook::GLOBAL_SEARCH_AFTER`
    - `PanelsRenderHook::USER_MENU_AFTER`

### Production-aware visibility

[](#production-aware-visibility)

The Dictionary action is hidden in production by default unless explicitly enabled.

### Extension points for Premium / third-party packages

[](#extension-points-for-premium--third-party-packages)

Dictionary Core now exposes a small set of stable extension points so premium modules or internal packages can build on the OSS workflow without forking the generators.

- **Capability resolver**

    - resolve named capabilities such as `premium.blocks` or `premium.revisions.browser`
    - defaults to a safe false-y resolver until another package defines a capability
- **Block registry**

    - merge additional block definitions into an existing block list while preserving base ordering
    - useful for premium-only content blocks or internal blueprint presets
- **UI extension registry**

    - register additional Dictionary tabs
    - append create/edit schema fragments
    - append existing-resource fragments
- **Post-generation hooks**

    - run logic after a blueprint is generated and its revision is recorded
    - useful for audit trails, premium revision tooling, or project-specific follow-up automation
- **Versioned revision snapshots**

    - blueprint revisions now expose a versioned snapshot payload plus metadata
    - gives future diff / restore tooling a stable contract to build on

Minimal access example:

```
use ribeiroconde\Dictionary\DictionaryPlugin;

DictionaryPlugin::capabilities()->define('premium.blocks', true);

DictionaryPlugin::blocks()->register([
    'type' => 'premium-carousel',
    'label' => 'Premium Carousel',
]);

DictionaryPlugin::generationHooks()->afterGenerate(
    function ($blueprint, $blueprintData, $plan, bool $shouldRunMigration): void {
        // custom follow-up logic
    }
);
```

---

Planned premium edition
-----------------------

[](#planned-premium-edition)

Dictionary today is focused on strong open-source CRUD scaffolding and safe regeneration loops.

A premium edition — **Dictionary PRO** — builds on that foundation with workflows especially useful for larger teams, legacy projects, and more complex data models.

### Available in Dictionary PRO

[](#available-in-dictionary-pro)

These features are already shipped in the premium package:

- **Visual revision history**

    - browse stored blueprint revisions
    - GitHub-style diff view of changes between snapshots
- **Blueprint comments / notes**

    - annotate blueprints with inline notes
    - basic team communication around blueprint changes
- **Blueprint approval workflows**

    - request and track approval for blueprint changes
    - basic review flow (full team mode in development)
- **Audit log browser**

    - inspect a searchable log of blueprint-related activity

### Coming soon

[](#coming-soon)

These features are planned for future PRO releases:

- **Rollback / restore workflows**

    - one-click restore of a previous blueprint revision
    - streamline reverting generated files and related schema changes
- **Legacy adoption / reverse engineering**

    - import existing models, tables, and resources into Dictionary
    - generate an editable blueprint from an existing Laravel project
- **Advanced relationship tooling**

    - many-to-many and pivot-table support
    - polymorphic relationship support
    - richer Filament relationship generation flows
- **Full team collaboration**

    - blueprint locks and ownership
    - broader audit trails and collaboration tooling (approvals and comments are available now)
- **Priority support**

    - commercial support for teams that want faster feedback and help

> Some PRO features are already available; others are still in development. The open-source package described in this README is the free, currently available product.

### Waiting list / early-bird pricing

[](#waiting-list--early-bird-pricing)

Before the premium edition launches, a waiting list is planned.

The idea is to offer **early-bird launch pricing** to people who join that waiting list before release.

Until pricing and packaging are finalized, it is safest to describe this as:

- planned early-access / waiting-list announcement
- likely early-bird pricing for pre-launch signups
- final details to be confirmed at launch

[Join the waiting list](https://filamentcomponents.com/wailtlist/dictionary?source=github)
------------------------------------------------------------------------------------------

[](#join-the-waiting-list)

Requirements
------------

[](#requirements)

- PHP `^8.3`
- Filament `^4.0|^5.0`

---

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

[](#installation)

### Fresh install

[](#fresh-install)

```
composer require ribeiroconde/filament-dictionary
php artisan dictionary:install
```

Then register the plugin in your Filament panel provider:

```
