PHPackages                             codewithdennis/filament-factory-action - 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. [Database &amp; ORM](/categories/database)
4. /
5. codewithdennis/filament-factory-action

AbandonedArchivedLibrary[Database &amp; ORM](/categories/database)

codewithdennis/filament-factory-action
======================================

This plugin adds a new feature to the Filament admin panel table, enabling easy generation of test records for your database tables using your Laravel Factory definitions.

v3.0.3(1y ago)378.8k↓32.4%5[1 PRs](https://github.com/CodeWithDennis/filament-factory-action/pulls)MITPHPPHP ^8.1CI failing

Since Oct 11Pushed 4mo ago2 watchersCompare

[ Source](https://github.com/CodeWithDennis/filament-factory-action)[ Packagist](https://packagist.org/packages/codewithdennis/filament-factory-action)[ Docs](https://github.com/codewithdennis/filament-factory-action)[ GitHub Sponsors](https://github.com/CodeWithDennis)[ RSS](/packages/codewithdennis-filament-factory-action/feed)WikiDiscussions 3.x Synced 1mo ago

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

Filament Factory Action
=======================

[](#filament-factory-action)

[![Latest Version on Packagist](https://camo.githubusercontent.com/e3bb9fa4f9e2a14fa22888fdbbc25e44d4568016525d1f47168c3ef98a3c40f6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f636f64657769746864656e6e69732f66696c616d656e742d666163746f72792d616374696f6e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/codewithdennis/filament-factory-action)[![Total Downloads](https://camo.githubusercontent.com/1ac40d4688433ff50696128c4ebdadbe129ce2f382d669ca647d908e6072944a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f636f64657769746864656e6e69732f66696c616d656e742d666163746f72792d616374696f6e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/codewithdennis/filament-factory-action)

[![Filament Factory Action](https://private-user-images.githubusercontent.com/23448484/274322351-405e92b9-68f5-4983-9619-2ce00a56eeab.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzM3ODYyMjQsIm5iZiI6MTc3Mzc4NTkyNCwicGF0aCI6Ii8yMzQ0ODQ4NC8yNzQzMjIzNTEtNDA1ZTkyYjktNjhmNS00OTgzLTk2MTktMmNlMDBhNTZlZWFiLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjAzMTclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYwMzE3VDIyMTg0NFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTdjYTY4MjMyOGQ0ZjUzZTE1YzFmN2Y2NGZmN2Q0YWNmNDdkYzAxMDI4NzdkNGI3ZTU0MjUyZGE0MTc2MDc4NmUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.BFGnPoYGI-CJG3QNDtWXaMboBAVt5ABppNW_ManW8xw)](https://private-user-images.githubusercontent.com/23448484/274322351-405e92b9-68f5-4983-9619-2ce00a56eeab.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzM3ODYyMjQsIm5iZiI6MTc3Mzc4NTkyNCwicGF0aCI6Ii8yMzQ0ODQ4NC8yNzQzMjIzNTEtNDA1ZTkyYjktNjhmNS00OTgzLTk2MTktMmNlMDBhNTZlZWFiLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjAzMTclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYwMzE3VDIyMTg0NFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTdjYTY4MjMyOGQ0ZjUzZTE1YzFmN2Y2NGZmN2Q0YWNmNDdkYzAxMDI4NzdkNGI3ZTU0MjUyZGE0MTc2MDc4NmUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.BFGnPoYGI-CJG3QNDtWXaMboBAVt5ABppNW_ManW8xw)

This plugin adds a new feature to the Filament admin panel table, enabling easy generation of test records for your database tables using your Laravel Factory definitions.

*This plugin extends the standard Filament action, ensuring that you can continue to utilize all the methods that are typically available within the action class*

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

[](#installation)

You can install the package via composer:

```
composer require codewithdennis/filament-factory-action
```

Usage Example
-------------

[](#usage-example)

Prior to utilizing this action, it is essential to ensure that you have set up a [factory](https://laravel.com/docs/10.x/eloquent-factories) for your model.

```
class ProfileFactory extends Factory
{
    public function definition(): array
    {
        return [
            'name' => fake()->company(),
            'is_public' => rand(0, 1),
        ];
    }
}
```

Suppose you already possess a `ProfileResource` within the Filament framework. You can integrate the action into the ListProfiles class, as demonstrated in the following example.

```
FactoryAction::make(),
```

```
use App\Filament\Resources\ProfileResource;
use CodeWithDennis\FactoryAction\FactoryAction;
use Filament\Actions;
use Filament\Resources\Pages\ListRecords;

class ListProfiles extends ListRecords
{
    protected static string $resource = ProfileResource::class;

    protected function getHeaderActions(): array
    {
        return [
            FactoryAction::make()
                ->color('danger')
                // ->slideOver()
                ->icon('heroicon-o-wrench'),
            Actions\CreateAction::make()
        ];
    }
}
```

You can create/attach relational records with the following example. Just make certain that these models also possess their respective factories

```
protected function getHeaderActions(): array
{
    return [
        FactoryAction::make()
            // If you want to create or create and attach you can do so using `hasMany`
            ->hasMany([Badge::class, Category::class])
            // If you want to attach existing models you can do so using `belongsToMany`
            ->belongsToMany([Badge::class, Category::class]),
    ];
}
```

The default behavior is to hide the action in production environments, but you can override this by using your own logic:

```
->hidden(fn() => false)
```

Showcase
--------

[](#showcase)

[![example-1](https://private-user-images.githubusercontent.com/23448484/274322119-a4d6a785-977e-4c3c-ad03-96ee06bd3c06.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzM3ODYyMjQsIm5iZiI6MTc3Mzc4NTkyNCwicGF0aCI6Ii8yMzQ0ODQ4NC8yNzQzMjIxMTktYTRkNmE3ODUtOTc3ZS00YzNjLWFkMDMtOTZlZTA2YmQzYzA2LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjAzMTclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYwMzE3VDIyMTg0NFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWUyMDc1Y2QxMjI4YzgzMjNlMGZhNTYyZTdhMzRmZTMyN2Q5ZWQ1ZTFmZWY5Yjc0MTdmMjY3YTg5NTVjZWI1MzkmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.u3RhVPNszcUROV6NSm8WP7YYuTpylGcaoV0ycWXQ_is)](https://private-user-images.githubusercontent.com/23448484/274322119-a4d6a785-977e-4c3c-ad03-96ee06bd3c06.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI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wMzE3VDIyMTg0NFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTg0ZTRmZTY2MDE1MDJiZDgzZGQ1ZjAwODA4NWE0ZjljYmJlYTYyNDdlYjhmNzdjYjM5M2QwMmJhZDU1ZWZmYmMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.5vszZUrDV20oUyo-KSHfp9Tb8gPybEnKhjV4GsTxw1Q)](https://private-user-images.githubusercontent.com/23448484/274399165-8eab103c-4ef3-4563-9202-afcb88d17ad2.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzM3ODYyMjQsIm5iZiI6MTc3Mzc4NTkyNCwicGF0aCI6Ii8yMzQ0ODQ4NC8yNzQzOTkxNjUtOGVhYjEwM2MtNGVmMy00NTYzLTkyMDItYWZjYjg4ZDE3YWQyLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjAzMTclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYwMzE3VDIyMTg0NFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTg0ZTRmZTY2MDE1MDJiZDgzZGQ1ZjAwODA4NWE0ZjljYmJlYTYyNDdlYjhmNzdjYjM5M2QwMmJhZDU1ZWZmYmMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.5vszZUrDV20oUyo-KSHfp9Tb8gPybEnKhjV4GsTxw1Q)[![example-3](https://private-user-images.githubusercontent.com/23448484/274399192-7772fbf3-f708-4d24-bc50-84334615b18f.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI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AyNjAzMTclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYwMzE3VDIyMTg0NFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWJkODBkYWE0OWU2ZWRjOGUwNWM0YWQ2ZmI1NWYzYWQzNTg5MzQ0YmE0OTgyNTVkNWI5NDZiMWFmYTM2NDA0MGYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.vKLOjK2eIIzPFWutVGatK8B0Gt-FZ5Y26UTQNMQ4Qm0)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)

- [CodeWithDennis](https://github.com/CodeWithDennis)
- [Adam Weston](https://github.com/awcodes)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

45

—

FairBetter than 92% of packages

Maintenance64

Regular maintenance activity

Popularity36

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 96.2% 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 ~105 days

Recently: every ~131 days

Total

6

Last Release

419d ago

Major Versions

3.x-dev → 4.x-dev2025-03-19

### Community

Maintainers

![](https://www.gravatar.com/avatar/6d47a56dfab94e67a7354a146f96a0285c09f6b9d649c558832c6a9b94354b8c?d=identicon)[CodeWithDennis](/maintainers/CodeWithDennis)

---

Top Contributors

[![CodeWithDennis](https://avatars.githubusercontent.com/u/23448484?v=4)](https://github.com/CodeWithDennis "CodeWithDennis (51 commits)")[![Z3d0X](https://avatars.githubusercontent.com/u/75579178?v=4)](https://github.com/Z3d0X "Z3d0X (2 commits)")

---

Tags

laravelfactoriesfilamentCodeWithDennisfilament-factory-action

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/codewithdennis-filament-factory-action/health.svg)

```
[![Health](https://phpackages.com/badges/codewithdennis-filament-factory-action/health.svg)](https://phpackages.com/packages/codewithdennis-filament-factory-action)
```

###  Alternatives

[dyrynda/laravel-model-uuid

This package allows you to easily work with UUIDs in your Laravel models.

4802.8M8](/packages/dyrynda-laravel-model-uuid)[codewithdennis/filament-select-tree

The multi-level select field enables you to make single selections from a predefined list of options that are organized into multiple levels or depths.

320392.1k17](/packages/codewithdennis-filament-select-tree)[spatie/laravel-model-flags

Add flags to Eloquent models

4301.1M1](/packages/spatie-laravel-model-flags)[clickbar/laravel-magellan

This package provides functionality for working with the postgis extension in Laravel.

423715.4k1](/packages/clickbar-laravel-magellan)[spatie/laravel-sql-commenter

Add comments to SQL queries made by Laravel

1931.4M1](/packages/spatie-laravel-sql-commenter)[spatie/laravel-deleted-models

Automatically copy deleted records to a separate table

409109.8k4](/packages/spatie-laravel-deleted-models)

PHPackages © 2026

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