orangehill/iseed
Generate Laravel database seeders from existing table data. iSeed adds an artisan command to export one or many tables (or all tables) into seeder classes, with optional class name prefix/suffix to avoid overwriting. Supports Laravel 8–13 (PHP 8+).
Start by installing the package via Composer (composer require orangehill/iseed). No service provider registration is needed in modern Laravel versions due to auto-discovery. The primary use case is generating seed files from existing production or staging database tables to migrate data between environments or create consistent test fixtures. The simplest command is php artisan iseed users, which creates UsersTableSeeder.php in database/seeders/ and registers it in DatabaseSeeder.php.
Use iseed for common workflows like snapshotting production data for local development (php artisan iseed --max=100 --database=production), generating partial seed sets for sensitive tables (php artisan iseed users --exclude=password,remember_token), or paginating large tables (php artisan iseed users --max=5000 --skip=0, then --skip=5000, etc.). Combine options for advanced scenarios: php artisan iseed orders,order_items --where="status='paid'" --skip-fk-checks --chunksize=200 ensures referential integrity and avoids memory issues. For staging-to-production consistency, pair --noregister with manual DatabaseSeeder edits to stage seeders incrementally.
Be aware of quoting requirements in shell—complex --where clauses must be escaped or wrapped in quotes depending on OS (e.g., --where="status='active'"). Foreign key constraints can break seeding; always use --skip-fk-checks for related tables on MySQL/SQLite. PostgreSQL users must combine --reset-sequences with FK-safe operations to avoid duplicate key errors after seeding. Monitor memory usage on large tables: adjust chunk_size in config/iseed.php or use --chunksize CLI option. Avoid overwriting legacy seeders—use --classnameprefix or --noregister for backups. For debugging, inspect generated PHP arrays in database/seeders/*.php to spot timestamp or JSON formatting issues before running db:seed.
How can I help you explore Laravel packages today?