PHPackages                             felipereisdev/filament-crud-maker - 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. felipereisdev/filament-crud-maker

ActiveLibrary

felipereisdev/filament-crud-maker
=================================

CRUD generator for Filament v4/v5 admin panels

v2.6.0(3d ago)26↓100%proprietaryPHPPHP ^8.3

Since Mar 21Pushed 3d ago1 watchersCompare

[ Source](https://github.com/felipereisdev/filament-crud-maker)[ Packagist](https://packagist.org/packages/felipereisdev/filament-crud-maker)[ RSS](/packages/felipereisdev-filament-crud-maker/feed)WikiDiscussions master Synced today

READMEChangelog (9)Dependencies (6)Versions (9)Used By (0)

Filament CRUD Maker
===================

[](#filament-crud-maker)

[![PHP 8.3+](https://camo.githubusercontent.com/38027453aeb7eb818641c9de8f82b7624c3558d92634f1946edc715c3ddf8956/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e332532422d3737374242343f6c6f676f3d706870266c6f676f436f6c6f723d7768697465)](https://php.net)[![Laravel 11/12/13](https://camo.githubusercontent.com/d9ee4708df76c3020e1cfe806419871e9ab3ad3b2b4e9ea1b8b0e6d37f5c4402/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c2d3131253230253743253230313225323025374325323031332d4646324432303f6c6f676f3d6c61726176656c266c6f676f436f6c6f723d7768697465)](https://laravel.com)[![Filament v4/v5](https://camo.githubusercontent.com/f355e5b084ecd55887e648ca93ff6f37e866ec1075842d26f2cfa2e7072fcad7/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f46696c616d656e742d763425323025374325323076352d4646414130303f6c6f676f3d646174613a696d6167652f7376672b786d6c3b6261736536342c50484e325a79423462577875637a30696148523063446f764c336433647935334d793576636d63764d6a41774d43397a646d636949485a705a58644362336739496a41674d4341794e4341794e43492b50484268644767675a4430695454457949444a4d4d6941794d6d67794d4577784d694179656949675a6d6c736244306964326870644755694c7a34384c334e325a7a343d)](https://filamentphp.com)[![PHPStan Level 9](https://camo.githubusercontent.com/25cc989bc38c27b246e31293a43998cb1c1529324a5d8b70ed43fff868bd3552/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048505374616e2d4c6576656c253230392d343639354434)](https://phpstan.org)[![License: MIT + Commons Clause](https://camo.githubusercontent.com/9e7fe8ec02b78c4df518fb8c8fb029e65fba1621a317e96afaedc111cfa09d73/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542532302b253230436f6d6d6f6e73253230436c617573652d626c75652e737667)](LICENSE.md)

A Laravel package that generates **complete CRUD resources** for Filament admin panels with a single Artisan command. Define your fields, relationships, and validations — the generator creates your Model, Migration, and fully configured Filament Resource with smart form components, table columns, filters, and actions.

**Key highlights:**

- **One command, full CRUD** — Model, Migration, Resource, Schema, and Table files generated at once
- **Interactive wizard** — Run the command without `--fields` and be guided step-by-step through field and relationship setup
- **30+ field types** — From simple text inputs to rich editors, file uploads, color pickers, key-value pairs, and more
- **Smart component mapping** — Each field type maps to the most appropriate Filament form component, table column, and filter
- **Relationship support** — `belongsTo`, `belongsToMany`, `hasOne`, `hasMany`, `morphTo`, `morphOne`, and `morphMany`
- **Soft delete filter** — `TrashedFilter` is automatically added to the table when `--softDeletes` is used
- **Built-in validation** — Apply rules like `required`, `min`, `max`, `email`, `unique`, `between`, and more directly in the command
- **Configurable namespaces** — Customize model and resource namespaces via the published config file
- **Automatic code formatting** — Generated files are formatted with Laravel Pint (PSR-12)
- **Filament v4/v5 compatible** — Supports both `form(Form $form)` and `form(Schema $schema)` signatures, separate Schemas/Tables directory structure (both Mode A and Mode B), and inline resources. Schema and Table files are detected independently

---

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

[](#requirements)

DependencyVersionPHP^8.3Laravel^11.28 | ^12.0 | ^13.0Filament^4.0 | ^5.0Installation
------------

[](#installation)

Install the package via Composer:

```
composer require freis/filament-crud-maker
```

The service provider is auto-discovered. Optionally, publish the configuration file:

```
php artisan vendor:publish --tag="filament-crud-maker-config"
```

This publishes `config/filament-crud-maker.php` where you can customize namespaces, auto-migration, and auto-formatting behavior.

You can also publish the Laravel Pint configuration:

```
php artisan vendor:publish --tag="pint-config"
```

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

[](#quick-start)

Generate a complete Product CRUD with fields, validations, and a category relationship in one command:

```
php artisan make:filament-crud Product \
  --fields="name:string:required:min=3:max=100,description:textarea,price:decimal:required,active:boolean:false,image:image:nullable" \
  --relations="belongsTo:Category" \
  --softDeletes
```

This creates:

- `app/Models/Product.php` with fillable fields, casts, and relationships
- `database/migrations/xxxx_create_products_table.php` with all columns and foreign keys
- `app/Filament/Resources/ProductResource.php` (or separate Schema/Table files for v4)
- `app/Models/Category.php` and its migration/resource (if they don't exist)

---

Usage
-----

[](#usage)

### Interactive Mode

[](#interactive-mode)

If you omit `--fields`, the command will detect that you are in an interactive terminal and offer a step-by-step wizard:

```
php artisan make:filament-crud Product
```

```
No --fields provided. Use interactive wizard? (yes/no) [yes]:
--- Field Wizard (leave name empty to finish) ---
Field name (empty to finish): name
Field type [string]: string
Nullable? (yes/no) [no]: no
Field name (empty to finish): price
Field type [string]: decimal
Nullable? (yes/no) [no]: no
Field name (empty to finish):
Add relationships? (yes/no) [no]: yes
Relation type [hasOne]: belongsTo
Related model name: Category
Add another relationship? (yes/no) [no]: no
Add soft deletes? (yes/no) [no]: yes

```

The wizard collects the same information as the CLI flags and assembles it into the standard format. Non-interactive invocations (piped, CI, `--no-interaction`) are unaffected.

### Command Syntax

[](#command-syntax)

```
php artisan make:filament-crud {model} [options]

```

Argument / OptionDescription`model`Name of the model (singular, PascalCase). Example: `Product`, `BlogPost``--fields=`Comma-separated list of fields. See [Field Format](#field-format)`--relations=`Semicolon-separated list of relationships. See [Relationships](#relationships)`--softDeletes`Add `SoftDeletes` trait and `softDeletes()` migration column`--no-migrate`Skip running migrations after generation`--no-format`Skip Laravel Pint auto-formatting`--clean-resources`Clean and regenerate all existing Filament resources### Field Format

[](#field-format)

Fields follow the format:

```
name:type[:default][:validation...]

```

SegmentRequiredDescription`name`YesThe database column / field name (snake\_case)`type`YesThe field type (see [Supported Field Types](#supported-field-types))`default`NoDefault value. Use `true`/`false` for booleans, numbers for numeric types, or a plain string for text/select types (e.g. `active`, `expense`). Applied to both the form component and the migration column.`validation`NoOne or more validation rules. Rules with values use `=` syntax (e.g. `min=3`)**Examples:**

```
# Simple field
name:string

# Field with default value
active:boolean:false

# Field with validations
email:string:required:email:unique

# Field with default and validations
price:decimal:0:required:min=0

# Field with between validation
score:integer:required:between=0,100

# Select field with string default
type:select:expense:required

# String field with column length
name:string:required:max=100
```

---

Supported Field Types
---------------------

[](#supported-field-types)

### Text &amp; String

[](#text--string)

TypeForm ComponentTable ColumnMigration Type`string``TextInput``TextColumn` (searchable, sortable)`string``text``TextInput``TextColumn` (searchable, sortable)`text``textarea``Textarea``TextColumn` (limit 50, tooltip)`text``longtext``Textarea``TextColumn` (limit 50, tooltip)`longText`### Numeric

[](#numeric)

TypeForm ComponentTable ColumnMigration Type`integer``TextInput` (numeric, step 1)`TextColumn` (numeric)`integer``bigInteger``TextInput` (numeric, step 1)`TextColumn` (numeric)`bigInteger``decimal``TextInput` (numeric, decimal)`TextColumn` (numeric/money\*)`decimal(10, 2)``float``TextInput` (numeric, decimal)`TextColumn` (numeric)`float(8, 2)``double``TextInput` (numeric, decimal)`TextColumn` (numeric)`double`> \* Fields named `price`, `preco`, or `valor` automatically use `->money('BRL')` formatting.

### Boolean

[](#boolean)

TypeForm ComponentTable ColumnMigration Type`boolean``Toggle``ToggleColumn``boolean``checkbox``Checkbox``ToggleColumn``boolean`### Date &amp; Time

[](#date--time)

TypeForm ComponentTable ColumnMigration Type`date``DatePicker``TextColumn` (date format)`date``datetime``DateTimePicker``TextColumn` (dateTime format)`datetime``time``TimePicker``TextColumn` (time format)`time`### Selection

[](#selection)

TypeForm ComponentTable ColumnMigration Type`select``Select` (with `->options([ /* TODO */ ])`)`TextColumn` (badge, searchable, sortable)`string``enum``Select` (with `->options([ /* TODO */ ])`)`TextColumn` (badge)`string``foreignId``Select` (with `->relationship()`)`TextColumn` (relationship)`foreignId``checkboxes``CheckboxList` (with `->options([ /* TODO */ ])`)`TextColumn``json``radio``Radio` (with `->options([ /* TODO */ ])`)`TextColumn` (badge, searchable, sortable)`string``toggleButtons``ToggleButtons` (with `->options([ /* TODO */ ])`)`TextColumn` (badge)`string`### File &amp; Media

[](#file--media)

TypeForm ComponentTable ColumnMigration Type`file``FileUpload` (`disk: public`, `dir: uploads`)`TextColumn``string``image``FileUpload` (image, 16:9 crop, `disk: public`, `dir: images`)`ImageColumn` (circular)`string`### Rich Content

[](#rich-content)

TypeForm ComponentTable ColumnMigration Type`richtext` / `editor``RichEditor``TextColumn` (limit 50, tooltip)`longText``markdown``MarkdownEditor``TextColumn` (limit 50, tooltip)`text`### Special

[](#special)

TypeForm ComponentTable ColumnMigration Type`color``ColorPicker``ColorColumn``string``tags``TagsInput``TextColumn` (badge)`json``code` / `json``CodeEditor``TextColumn` (limit 50, tooltip)`longText` / `json``slider` / `range``Slider``TextColumn` (numeric)`integer``keyvalue``KeyValue``TextColumn` (limit 50, tooltip)`json`---

Validation Rules
----------------

[](#validation-rules)

Apply validation rules to fields using the `rule` or `rule=value` syntax after the field type.

RuleSyntaxForm Component MethodDescriptionRequired`required``->required()`Field must be filledMinimum`min=N``->minLength(N)` or `->minValue(N)`Min length (text) or min value (numeric)Maximum`max=N``->maxLength(N)` or `->maxValue(N)`Max length (text) or max value (numeric). For `string` fields, also sets the column length in the migration: `$table->string('name', N)`Between`between=X,Y``->minValue(X)->maxValue(Y)`Value must be between X and Y. The comma inside the value is handled correctly and won't split the fieldEmail`email``->email()`Must be a valid email addressURL`url``->url()`Must be a valid URLPhone`tel``->tel()`Phone number inputPassword`password``->password()`Masked password inputConfirmed`confirmed``->confirmed()`Requires a confirmation fieldNullable`nullable``->nullable()`Field can be null (also applied to migration)Unique`unique``->unique()`Value must be unique (also applied to migration)Exists`exists=table,column``->exists('table', 'column')`Value must exist in another table**Example combining multiple rules:**

```
--fields="email:string:required:email:unique,age:integer:required:min=18:max=120"
```

---

Relationships
-------------

[](#relationships)

Define relationships using the `--relations` option. Multiple relationships are separated by semicolons (`;`).

### Format

[](#format)

```
relationType:RelatedModel[:field1:type,field2:type]

```

You can optionally specify fields for the related model. If the related model doesn't exist, it will be created automatically along with its migration and Filament resource.

### Supported Relationship Types

[](#supported-relationship-types)

TypeDescriptionAutomatic Actions`belongsTo`Many-to-one (e.g. Product belongs to Category)Adds `foreignId` column + `constrained()->onDelete('cascade')` to migration`belongsToMany`Many-to-many (e.g. Course has many Students)Creates pivot table with foreign keys and unique constraint. Generates `Select::make()->multiple()->relationship()` in the form. Also generates the inverse relationship on the related model`hasOne`One-to-one (e.g. User has one Profile)Adds relationship method to model. Automatically adds `foreignId` + `constrained()` FK column to the related model's migration (uses a separate alter migration when the target table already exists or has custom fields to avoid FK ordering issues). Alter migrations generate the FK column as **nullable** for safety with existing data. Also updates the related model's `$fillable` array and adds the inverse `belongsTo` relationship method`hasMany`One-to-many (e.g. Course has many Lessons)Adds relationship method to model. Automatically adds `foreignId` + `constrained()` FK column to the related model's migration (uses a separate alter migration when the target table already exists or has custom fields to avoid FK ordering issues). Alter migrations generate the FK column as **nullable** for safety with existing data. Also updates the related model's `$fillable` array and adds the inverse `belongsTo` relationship method`morphTo`Polymorphic inverse (e.g. Comment belongs to Post or Video)Adds `$table->morphs('{morphName}')` to migration; the second segment is the morph name`morphOne`Polymorphic one-to-one (e.g. Post has one Image)Adds relationship method. Morph name can be explicit (`morphOne:Attachment:attachable`) or auto-derived (`{snake(relatedModel)}able`)`morphMany`Polymorphic one-to-many (e.g. Post has many Comments)Adds relationship method. Morph name can be explicit (`morphMany:Attachment:attachable`) or auto-derived (`{snake(relatedModel)}able`)**Polymorphic examples:**

```
# Comment model that can belong to Post or Video
--relations="morphTo:commentable"

# Post model that morphs one Image and many Comments
--relations="morphOne:Image;morphMany:Comment"

# Attachment model with morphTo, and parent models with explicit morph name
# Child: --relations="morphTo:attachable"
# Parent: --relations="morphMany:Attachment:attachable"
```

For `morphTo`, the second segment is the **morph name** (e.g. `commentable`), not a model class. The generator adds `$table->morphs('commentable')` to the migration and `$this->morphTo()` to the model.

For `morphOne` and `morphMany`, the second segment is the **related model class**. You can optionally provide the **morph name** as a third segment to match the `morphTo` side exactly:

```
# Explicit morph name (recommended when the morph name differs from the auto-derived one)
--relations="morphMany:Attachment:attachable"

# Auto-derived morph name: {snake(relatedModel)}able (e.g. imageable, commentable)
--relations="morphOne:Image"
```

When using `morphTo:attachable` on the child model, make sure the parent's `morphMany` or `morphOne` uses the same morph name (`attachable`), either explicitly or by auto-derivation.

### Examples

[](#examples)

**Single relationship:**

```
--relations="belongsTo:Category"
```

**Multiple relationships:**

```
--relations="belongsTo:Category;hasMany:Comment;belongsToMany:Tag"
```

**Relationship with fields for the related model:**

```
--relations="belongsTo:Category:name:string:required,slug:string:unique;hasMany:Review:rating:integer:required,comment:text"
```

> **Pivot tables** for `belongsToMany` relationships are automatically created with the correct naming convention (alphabetical order), foreign keys, and a unique constraint on the pair.

---

Practical Examples
------------------

[](#practical-examples)

### 1. Blog Post with basic fields

[](#1-blog-post-with-basic-fields)

```
php artisan make:filament-crud Post \
  --fields="title:string:required:min=5:max=200,slug:string:unique,content:richtext:required,excerpt:textarea:nullable,published_at:datetime:nullable,is_featured:boolean:false"
```

### 2. E-commerce Product with relationships

[](#2-e-commerce-product-with-relationships)

```
php artisan make:filament-crud Product \
  --fields="name:string:required:min=3,description:markdown:required,price:decimal:required:min=0,sku:string:unique,stock:integer:0:required:min=0,active:boolean:true,image:image:nullable" \
  --relations="belongsTo:Category;belongsTo:Brand;belongsToMany:Tag" \
  --softDeletes
```

### 3. Course platform with complex relations

[](#3-course-platform-with-complex-relations)

```
php artisan make:filament-crud Course \
  --fields="name:string:required:min=3:unique,description:markdown:required,price:decimal:required:between=0,9999.99,duration:integer:required,color:color:nullable,published:boolean:false" \
  --relations="belongsTo:Teacher:name:string:required,email:string:email;belongsToMany:Student;hasMany:Lesson:title:string:required,content:richtext,order:integer:0"
```

### 4. Settings page with special fields

[](#4-settings-page-with-special-fields)

```
php artisan make:filament-crud Setting \
  --fields="key:string:required:unique,value:text:nullable,type:select,metadata:json:nullable,tags:tags:nullable,config:keyvalue:nullable"
```

---

Configuration
-------------

[](#configuration)

After publishing, the config file is located at `config/filament-crud-maker.php`:

```
return [
    // Namespace where models will be created
    // All model file paths and import statements are derived from this value
    'model_namespace' => 'App\\Models',

    // Namespace where Filament Resources will be created
    // All resource file paths and import statements are derived from this value
    'resource_namespace' => 'App\\Filament\\Resources',

    // Run migrations automatically after generation (override with --no-migrate)
    'auto_migrate' => true,

    // Format generated code with Laravel Pint (override with --no-format)
    'auto_format' => true,
];
```

Both `model_namespace` and `resource_namespace` are fully respected by the generator — all file path resolution and `use` import statements are derived from these values. If you use a non-standard namespace (e.g. a DDD structure), update these keys and the generator will place and import files correctly.

What Gets Generated
-------------------

[](#what-gets-generated)

For each model, the generator creates or updates:

FileLocationDescription**Model**`app/Models/{Model}.php`Eloquent model with `$fillable`, `$casts`, relationship methods, and optionally `SoftDeletes`**Migration**`database/migrations/xxxx_create_{table}_table.php`Migration with all column types, foreign keys, defaults, nullable/unique constraints**Resource**`app/Filament/Resources/{Model}Resource.php`Filament resource entry point**Schema**`.../{Model}Resource/Schemas/{Model}Form.php`Form schema with all field components (Filament v4 structure)**Table**`.../{Model}Resource/Tables/{PluralModel}Table.php`Table with columns, filters, edit actions, and bulk delete (Filament v4 structure)**Automatic features:**

- **Fillable fields** — All defined fields are added to the model's `$fillable` array
- **Type casts** — Boolean, date, datetime, integer, decimal, and JSON fields get proper Eloquent casts
- **Options placeholder** — Selection components (`Select`, `Radio`, `ToggleButtons`, `CheckboxList`) include `->options([ /* TODO */ ])` with a TODO comment for discoverability; `foreignId` and `belongsToMany` use `->relationship()` instead. `SelectFilter` for non-relationship fields also includes the TODO placeholder
- **Smart imports** — Only the required Filament component classes are imported, with no duplicates. Existing imports not managed by the generator (e.g. `BackedEnum`, `Heroicon`, Page classes) are preserved
- **Relationship return types** — Generated relationship methods include proper return type hints (e.g. `: HasMany`, `: BelongsTo`)
- **Table filters** — Boolean fields get ternary filters; date/numeric fields get range filters; foreign keys get select filters
- **Table actions** — Edit action and bulk delete are automatically configured
- **Code formatting** — All generated files are formatted with Laravel Pint (PSR-12)

---

Flags &amp; Options
-------------------

[](#flags--options)

### `--softDeletes`

[](#--softdeletes)

Adds the `SoftDeletes` trait to the model and a `softDeletes()` column to the migration. The generated table automatically includes a `TrashedFilter` so administrators can view, restore, and permanently delete soft-deleted records from the Filament UI.

### `--no-migrate`

[](#--no-migrate)

Skips running `php artisan migrate` after file generation. Useful when you want to review or adjust the migration before running it. You can also disable auto-migration globally in the config file.

### `--no-format`

[](#--no-format)

Skips Laravel Pint auto-formatting. Useful in CI environments or when you prefer to format manually. You can also disable auto-formatting globally in the config file.

### `--clean-resources`

[](#--clean-resources)

Cleans and regenerates all existing Filament resources in your application. This re-processes imports and formatting across all resource files.

```
php artisan make:filament-crud --clean-resources
```

---

Development
-----------

[](#development)

### Setup

[](#setup)

```
git clone https://github.com/felipereisdev/filament-crud-maker.git
cd filament-crud-maker
composer install
```

### Commands

[](#commands)

```
# Run tests
composer test

# Run static analysis (PHPStan level 9)
composer analyse

# Format code (PSR-12)
composer format
```

### Running a single test

[](#running-a-single-test)

```
vendor/bin/pest --filter test_method_name
```

---

License
-------

[](#license)

This package is open-source software licensed under the [MIT license](LICENSE.md).

###  Health Score

46

—

FairBetter than 93% of packages

Maintenance99

Actively maintained with recent releases

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~45 days

Recently: every ~0 days

Total

9

Last Release

3d ago

Major Versions

1.0.0 → v2.0.02026-03-19

PHP version history (2 changes)1.0.0PHP ^8.1

v2.0.0PHP ^8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/cf4536ab0c5799e0a8664dc47746371809937522e2073806128628d180b4f6d6?d=identicon)[freis](/maintainers/freis)

---

Top Contributors

[![felipereisdev](https://avatars.githubusercontent.com/u/7799406?v=4)](https://github.com/felipereisdev "felipereisdev (30 commits)")

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/felipereisdev-filament-crud-maker/health.svg)

```
[![Health](https://phpackages.com/badges/felipereisdev-filament-crud-maker/health.svg)](https://phpackages.com/packages/felipereisdev-filament-crud-maker)
```

###  Alternatives

[codewithdennis/larament

Larament is a time-saving starter kit to quickly launch Laravel 12.x projects. It includes FilamentPHP 4.x pre-installed and configured, along with additional tools and features to streamline your development workflow.

3651.5k](/packages/codewithdennis-larament)

PHPackages © 2026

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