PHPackages                             mgamal92/filament-demo-generator - 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. mgamal92/filament-demo-generator

ActiveLibrary[Admin Panels](/categories/admin)

mgamal92/filament-demo-generator
================================

Generate demo data for any Filament resource

v1.4.0(11mo ago)20MITPHPPHP ^8.1

Since Jul 13Pushed 11mo agoCompare

[ Source](https://github.com/mgamaldev/filament-demo-generator)[ Packagist](https://packagist.org/packages/mgamal92/filament-demo-generator)[ RSS](/packages/mgamal92-filament-demo-generator/feed)WikiDiscussions main Synced today

READMEChangelog (6)Dependencies (3)Versions (8)Used By (0)

Filament Demo Generator
=======================

[](#filament-demo-generator)

A Filament plugin that helps you generate realistic **demo data** for any resource — in just one click.

Whether you're testing layouts, showcasing features, or kicking off a new dashboard — skip writing manual seeders and fill your tables instantly.

---

Features
--------

[](#features)

- One smart **"Generate / Delete Demo Data"** button added to any resource
- Dynamic label, color, and modal content based on state
- Custom modal with option to set number of records
- Built-in delete confirmation for demo data
- Caches generated record IDs for precise cleanup
- Fires `DemoDataGenerated` event after creation for extensibility
- Smart field detection using `fillable`
- Auto-handles `BelongsTo` relationships
- Enum fields are fully supported — random value selected automatically
- Faker-powered values based on field types
- Supports text, number, email, dates, enums, and more
- Fully extendable — hook into the generator or replace logic as needed

---

BelongsTo Relationships
-----------------------

[](#belongsto-relationships)

The package automatically handles `BelongsTo` relationships:

- If related records exist, a random one is selected and linked.
- If no related records are found, a new record is created and linked automatically.
- This process does not require Laravel factories and works based on `fillable` attributes.

For example, if your model has a `user_id` field and a `user()` relationship, the generator will automatically populate it correctly.

---

Event: DemoDataGenerated
------------------------

[](#event-demodatagenerated)

After demo data is created, the following event is fired:

```
Mgamal92\FilamentDemoGenerator\Events\DemoDataGenerated
```

You can listen to it like this:

```
use Mgamal92\FilamentDemoGenerator\Events\DemoDataGenerated;

Event::listen(DemoDataGenerated::class, function ($event) {
    logger('Demo generated for: ' . $event->model);
});
```

Payload includes:

- `$event->model`
- `$event->count`
- `$event->ids` (array of record IDs)

---

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

[](#configuration)

You can customize how fake demo data is generated by publishing the config file:

```
php artisan vendor:publish --tag=config --provider="Mgamal92\FilamentDemoGenerator\FilamentDemoGeneratorServiceProvider"
```

This will create a `filament-demo-generator.php` file in your `config` directory. You can customize:

- Value generators for specific field names (e.g., "email", "phone")
- Generators by column type (e.g., "string", "integer", "date")
- Supported faker patterns

---

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

[](#installation)

```
composer require mgamal92/filament-demo-generator
```

---

Usage
-----

[](#usage)

After installation, a **"Generate Demo Data"** button will appear in the table header of any Filament resource.

If demo data already exists, the same button becomes **"Delete Demo Data"**, and deletes only the records it generated.

---

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

[](#contributing)

Contributions are welcome!

If you have suggestions for improving the plugin, want to support new field types, or help with localization, feel free to open an issue or submit a pull request.

1. Fork the repo
2. Make your changes
3. Submit a PR

---

License
-------

[](#license)

MIT License

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance50

Moderate activity, may be stable

Popularity3

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

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 ~0 days

Total

6

Last Release

352d ago

### Community

Maintainers

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

---

Tags

backenddashboarddata-generatordemofakerfilamentlaravelphpseeder

### Embed Badge

![Health badge](/badges/mgamal92-filament-demo-generator/health.svg)

```
[![Health](https://phpackages.com/badges/mgamal92-filament-demo-generator/health.svg)](https://phpackages.com/packages/mgamal92-filament-demo-generator)
```

###  Alternatives

[bezhansalleh/filament-exceptions

A Simple &amp; Beautiful Pluggable Exception Viewer for FilamentPHP's Admin Panel

196223.8k15](/packages/bezhansalleh-filament-exceptions)[a2insights/filament-saas

Filament Saas for A2Insights

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

PHPackages © 2026

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