PHPackages                             lartisan/filament-architect - 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. lartisan/filament-architect

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

lartisan/filament-architect
===========================

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

v0.2.0(1mo ago)31409↓18.8%3[1 PRs](https://github.com/lartisan/filament-architect/pulls)MITPHPPHP ^8.3CI passing

Since Mar 2Pushed 1mo ago3 watchersCompare

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

READMEChangelog (7)Dependencies (16)Versions (9)Used By (0)

Filament Architect
==================

[](#filament-architect)

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/aa7e7c8d8953484429a0539d42e2d6feff0fc8673e391a95b94c4af678c85777/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c6172746973616e2f66696c616d656e742d6172636869746563742e737667)](https://packagist.org/packages/lartisan/filament-architect)[![GitHub Tests](https://camo.githubusercontent.com/ed72fe7a34c424a5f179a71157ced3bdec14cfab258f01a6d275a0af8afb6393/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6c6172746973616e2f66696c616d656e742d6172636869746563742f74657374732e796d6c3f6c6162656c3d5465737473)](https://github.com/lartisan/filament-architect/actions)[![Total Downloads](https://camo.githubusercontent.com/827ff586afffe3d233aee34082a94ec05a386339a4942db1489e3a4e6f24e19a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6c6172746973616e2f66696c616d656e742d6172636869746563742e737667)](https://packagist.org/packages/lartisan/filament-architect)[![License](https://camo.githubusercontent.com/fa890a0dbb9748122e50c064f9e97d5a5e1e844efa02981627c4470e5e25217e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6c6172746973616e2f66696c616d656e742d6172636869746563742e737667)](https://packagist.org/packages/lartisan/filament-architect)

Important

`v1.0.0` introduces new database migrations for Filament Architect. If you are upgrading from `v0.1.5` or earlier, publish the latest package migrations and run:

```
php artisan migrate
```

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 an existing install? Review [`UPGRADE.md`](UPGRADE.md) before opening Architect in your panel.

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

```
composer require lartisan/filament-architect
php artisan architect:install
php artisan migrate
```

```
use Lartisan\Architect\ArchitectPlugin;

->plugins([
    ArchitectPlugin::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)

Architect 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 Architect 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)

Architect 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)

Architect 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, Architect 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 `ARCHITECT_FILAMENT_VERSION=v3`)
- Generates resources in the correct structure for your Filament version (`v4`/`v5` domain by default, `v3` flat as legacy) — controlled by `ARCHITECT_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 Architect action is hidden in production by default unless explicitly enabled.

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

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

Architect 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 Architect 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 Lartisan\Architect\ArchitectPlugin;

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

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

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

---

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

[](#planned-premium-edition)

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

A future premium edition is planned to build on that foundation with workflows that are especially useful for larger teams, legacy projects, and more complex data models.

Planned premium areas currently include:

- **Visual revision history**

    - browse stored blueprint revisions
    - inspect snapshot diffs and generated changes visually
- **Rollback / restore workflows**

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

    - import existing models, tables, and resources into Architect
    - 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
- **Team-oriented workflows**

    - approvals and change review flows
    - blueprint locks, audit trails, and collaboration-oriented tooling
- **Priority support**

    - commercial support for teams that want faster feedback and help

> These features are planned / proposed, not shipped yet. The open-source package described in this README is the 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/architect?source=github)
-----------------------------------------------------------------------------------------

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

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

[](#requirements)

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

---

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

[](#installation)

For a new installation:

```
composer require lartisan/filament-architect
php artisan architect:install
php artisan migrate
```

Then register the plugin in your Filament panel provider:

```
