No argument seeds every table, clean rewrites DatabaseSeeder, and the two event hooks are not symmetric
Laravel Inverse Seed Generator
At a glance
- What is it?
- iseed is an Artisan command that turns rows already in a database into Laravel seeder classes, and most of its documentation is a list of options that quietly change how much of your project the command touches: the default scope is every table, one option shells out to composer, another rewrites DatabaseSeeder.php, and the two event hooks behave differently in the one way that matters when a listener fails.
- Who is it for?
- iseed fits a Laravel project that needs fixture data out of a development database rather than invented records, and the generated files are ordinary seeder classes you can edit afterwards. Four things to know before running it on anything you care about.
- Can I use it commercially?
- Yes. BSD-2-Clause is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Yes. The repository last received commits 144 days ago.
- What is it written in?
- Mainly PHP, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on November 13, 2026, and from our analysis. They are not legal advice.
Star history
- orangehill/iseed2,895 ★ · +1
| Repository | 2026-10-04 | 2026-11-13 |
|---|---|---|
| orangehill/iseed | 2.9k | 2.9k |
1 Stars in the last 40 days, measured from the daily GitHub snapshot. Compare with other projects
Editorial analysis
No argument means every table in the database
The table argument is optional, and the documented behaviour when it is omitted is the widest scope the command has:
php artisan iseedThe README says the command automatically retrieves all table names from the database and generates seeders for every table. With the argument given, it takes one name or a comma separated list and writes one seed file per table:
php artisan iseed my_table
php artisan iseed my_table,another_tableSo the shape of the default is worth being explicit about. A developer who types the command name and nothing else gets a file for every table in the connection, including the ones they did not think about, which on a schema with migrations is rarely a small number.
Two options narrow the output. --max sets a ceiling on the number of entries written, and the documentation notes that with several tables the limit applies to all of them, so it cannot be used to give one table a large sample and another a small one. --exclude takes a comma separated list of columns to leave out, and likewise applies to every table in the run. Nothing else in the option list restricts which tables are read.
The clean option rewrites the file Laravel keeps your registrations in
Three options touch files that may already exist, and one of them is not about seeds at all.
--force automatically overwrites any existing seeds for the tables you name. The documentation uses UsersTableSeeder.php as its example, so the file being replaced is a seeder someone else wrote.
--clean is different in kind. It cleans database/seeders/DatabaseSeeder.php before creating the new seed class. That file is the one place a Laravel project registers its seeders, and it is exactly the file a developer is most likely to have edited by hand, whether to add a call, reorder the list or leave a comment. The documentation describes the option in one sentence and gives the example php artisan iseed users --clean, with no warning about what is lost.
The third option is the constructive alternative. --classnameprefix and --classnamesuffix change the class and file name, and the stated use is creating an additional seed for a table that already has one without overwriting it, producing names such as CustomizedMyTableSeeder.php or MyTableCustomizationsSeeder.php. Two tables with a prefix produce CustomizedMyTableSeeder.php and CustomizedAnotherTableSeeder.php.
So the file naming options are the safe path, --force is the blunt one, and --clean is the one that edits a file outside the seed directory.
Generating a seed runs composer dump-autoload by default
One option controls whether the command shells out to Composer, and its default is on.
The --dumpauto flag is described as a boolean parameter controlling the execution of the composer dump-autoload command, and it defaults to true. Turning it off is a single flag:
php artisan iseed users --dumpauto=falseThat default is a reasonable convenience, since a newly written seeder class is not discoverable until the autoloader knows about it, and Laravel's own workflow expects that command to run. It is also the reason the option exists, which means the failure mode people hit is the opposite one: a command that quietly runs Composer inside a test or a deployment script and takes longer, or behaves differently, than expected.
The flag is documented alongside the others without a note about environments where running Composer is unwelcome. A reader working in continuous integration would want to know that this is the default rather than discovering it from a slow step in a log.
A failed prerun stops the seed and a failed postrun does not
The two event hooks are documented in parallel paragraphs with parallel examples, and they do not behave the same way.
--prerun assigns a Laravel event name to be fired before seeding takes place. The documentation states that if an event listener returns false, the seed will fail automatically. That is a gate: the check happens before the rows are written.
--postrun assigns an event name to be fired after seeding takes place, and here the sentence changes. If an event listener returns false, the seed will be executed, but an exception will be thrown that the postrun failed.
So the return value means opposite things in the two places. A prerun listener is a veto. A postrun listener is a report, and the data is already committed by the time the exception surfaces. Anything that depends on the hook to prevent a write has to go in the prerun.
Both hooks take comma separated lists that map per table, and the documentation is careful about the empty slot: with two tables and a leading empty value, only the second table gets an event and the first is left with none. That example appears twice, once per hook.
The newest release is titled as a fix for a fatal error in the prerun and postrun event hooks, which suggests these two options have been the fragile part of the command.
max, orderby and direction only make sense as a set
Three options describe one feature and are documented as three separate parameters in three separate paragraphs.
--max sets the maximum number of entries seeded from a table. --orderby defines the column used to order the results, and the documentation is explicit that it is used in conjunction with max, which is the option that allows a desired number of exported entries. --direction sets the ordering direction and is used in conjunction with orderby.
Put together they read:
artisan iseed users --max=10 --orderby=id --direction=descThe dependency matters more than it looks. Without --orderby, a --max run takes whichever rows the database returns first, which is not a defined set on any engine and can change between runs against the same data. And --direction without --orderby has nothing to be a direction of.
The documentation never says this in one place, so a reader who reads the max paragraph and runs it will get a sample of unknown composition and may not connect that to the missing orderby.
chunksize decides how many rows share one insert
One option controls the shape of the generated code rather than its content: --chunksize defines the size of data chunks for each insert query.
php artisan iseed users --chunksize=100That is the difference between a generated seeder that issues one enormous insert for a large table and one that writes in batches, and it matters for reasons that are not about speed. Databases cap the size of a single statement, proxies in front of a connection cap it too, and a single huge statement is harder to read in a diff when someone opens the generated file six months later.
It is also the option with no default value documented anywhere in the visible documentation, which leaves the generated file's behaviour to the package's own choice rather than the reader's.
The companion content option is --exclude, which takes columns rather than rows. Its documented use is leaving columns out of the tables being exported, with the same all-tables behaviour as --max, so a table with a column that does not exist on another connection needs an exclude list rather than an edit afterwards.
The install section still covers Laravel 4 and a truncated option
The README opens by stating that the package supports Laravel 8, 9, 10, 11, 12 and 13 with PHP 8.0 and above, and the newest release is titled Laravel 13.x compatibility.
Below that, the installation section still carries instructions for versions that predate the supported range by a decade. There are pinned Composer commands for Laravel 5.3.7 and below and for Laravel 4, under a heading that says those versions need a specific version. And there is a step for adding the service provider to the providers array in the application configuration file by hand, for Laravel 5.4 and below, with the class name given, because newer versions discover it automatically.
Two smaller things sit alongside. The header carries the same Packagist badge three times, all pointing at the same package page. And the last option in the visible documentation, --noregister, has a description that stops partway through a sentence: it says the seed file will be generated but will not be added, and the sentence ends there.
The repository itself is small and tidy, with a Composer manifest, a PHPUnit configuration, a source directory and a tests directory at the root, which is more than several comparable packages of this size carry.
Editorial conclusion
iseed fits a Laravel project that needs fixture data out of a development database rather than invented records, and the generated files are ordinary seeder classes you can edit afterwards. Four things to know before running it on anything you care about. With no table argument it walks every table in the database, so --max and --exclude are the brakes rather than an afterthought. Generating a seed runs composer dump-autoload unless you pass --dumpauto=false. The --clean option rewrites database/seeders/DatabaseSeeder.php, which is the one file in a Laravel project most likely to contain edits of your own. And the prerun hook can stop a seed while the postrun hook cannot, so a postrun listener that returns false leaves the data written and only then raises an exception. The newest release, v3.8.1 from 2026-06-24, is titled as a fix for a fatal error in those two hooks.
Frequently asked questions
What does the iseed Laravel package do?
It is an inverse seed generator: an Artisan command that builds a seeder class from rows already in a database table. Give it one table name or a comma separated list, or no argument at all, in which case it retrieves every table name from the database and generates a seeder for each one.
How do I stop iseed overwriting an existing seeder?
Do not pass --force, which overwrites existing seeds for the tables you name. Use --classnameprefix or --classnamesuffix to produce an additional file with a different class and file name, or --clean, which clears database/seeders/DatabaseSeeder.php before registering the new class.
What do the prerun and postrun options do in iseed?
Each assigns a Laravel event name to be fired around seeding, per table when comma separated lists are passed. A prerun listener that returns false fails the seed before it runs, while a postrun listener that returns false lets the seed execute and only then throws that the postrun failed, so the two are not symmetric.
Which Laravel versions does iseed support?
The README states Laravel 8 through 13 with PHP 8.0 and above, and the v3.8.0 release is titled Laravel 13.x compatibility. The installation section still documents pinned versions for Laravel 5.3.7 and below and for Laravel 4, plus manual service provider registration for 5.4 and below.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/orangehill-iseed)Star history chart for your README
[](https://hysenlabs.com/projects/orangehill-iseed)Was this useful?