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(10mo ago)20MITPHPPHP ^8.1

Since Jul 13Pushed 10mo agoCompare

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

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

30

—

LowBetter than 64% of packages

Maintenance55

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

301d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/666ab97c9a135dab4474eff536dbbb273da2082971ceb4c5dbbdd624e131da15?d=identicon)[mgamal92](/maintainers/mgamal92)

---

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

[slowlyo/owl-admin

基于 laravel、amis 开发的后台框架~

61214.2k26](/packages/slowlyo-owl-admin)[guava/filament-knowledge-base

A filament plugin that adds a knowledge base and help to your filament panel(s).

206120.5k1](/packages/guava-filament-knowledge-base)[geo-sot/filament-env-editor

Access .env file though Filament admin panel

2432.3k1](/packages/geo-sot-filament-env-editor)[a2insights/filament-saas

Filament Saas for A2Insights

161.1k](/packages/a2insights-filament-saas)[takielias/tablar-kit

The Elegance of Tablar Dashboard

413.4k](/packages/takielias-tablar-kit)[jeffersongoncalves/filament-topbar

A simple yet effective Filament plugin that automatically adds a customized topbar to your Filament admin panel. This plugin enhances your Filament panel's user experience by replacing the default topbar component with an improved version that displays navigation and user interface elements in strategic locations.

171.2k](/packages/jeffersongoncalves-filament-topbar)

PHPackages © 2026

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