Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Iseed Laravel Package

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+).

View on GitHub
Deep Wiki
Context7
v3.8.0

What's New

Full Changelog

https://github.com/orangehill/iseed/compare/v3.7.2...v3.8.0

v3.7.2

Bug Fix

  • Use explicit nullable types (?Filesystem, ?Composer) in Iseed constructor to resolve PHP 8.4 deprecation warning (#231)

Thanks to @dragonfly4 for reporting!

v3.7.1

Documentation

  • Remove broken Travis CI badge (travis-ci.org shut down)
  • Remove deprecated Google Analytics badge
  • Update badges to .svg format for live updates
  • Add License badge
  • Update README examples to match actual generated output:
    • Add namespace Database\Seeders
    • Add use Illuminate\Database\Seeder
    • Change truncate() to delete() to match actual code
  • Update all path references from database/seeds to database/seeders (Laravel 8+)
v3.7.0

Features

  • Add --reset-sequences option for PostgreSQL (#160): Resets PostgreSQL sequences after seeding to prevent "duplicate key value violates unique constraint" errors when inserting new records.
php artisan iseed users --reset-sequences

Bug Fixes

  • Fix whitespace trimming in multiline strings (#191): The prettifyArray() function now preserves whitespace inside multiline string values, fixing issues with YAML, JSON, or other data where indentation is significant.

Contributors

Thanks to @Magentron for reporting the whitespace issue and @cjlaborde for reporting the PostgreSQL sequence issue.

v3.6.0

New Feature

  • --skip option: Skip a specified number of rows before exporting. Useful for paginating through large datasets.

Usage

# Export first 1000 rows
php artisan iseed users --max=1000 --orderby=id

# Export next 1000 rows (skip first 1000)
php artisan iseed users --max=1000 --skip=1000 --orderby=id

# Export rows 2001-3000
php artisan iseed users --max=1000 --skip=2000 --orderby=id

Bug Fix

  • Fixed default direction to ASC when using --orderby without explicit --direction

Thanks

Thanks to @whoisryosuke for PR #143.

v3.5.0

New Feature

  • --skip-fk-checks option: Disable foreign key checks during seeding. Useful for tables with FK constraints that would fail on delete/insert operations.

Usage

php artisan iseed users --skip-fk-checks

This generates:

\DB::statement('SET FOREIGN_KEY_CHECKS=0;');
\DB::table('users')->delete();
\DB::table('users')->insert(...);
\DB::statement('SET FOREIGN_KEY_CHECKS=1;');

Note: This generates MySQL-specific statements.

Thanks

Thanks to @aomini for PR #157.

v3.4.0

Fix

  • Database connection in seeders: When using --database with a non-default connection, the generated seeder now properly uses DB::connection('name')->table() instead of just DB::table(). This prevents accidental data operations on the wrong database.

Example

# Default database - generates: \DB::table('users')
php artisan iseed users

# Non-default database - generates: \DB::connection('mysql2')->table('users')
php artisan iseed users --database=mysql2

Thanks

Thanks to @Endy-c for PR #212.

v3.3.0

New Feature

  • Custom stub templates: Specify a custom stub path via config/iseed.php to customize the generated seed file format.

Usage

Create config/iseed.php in your Laravel application:

<?php
return [
    'stub_path' => resource_path('stubs'),
];

Then create your custom stub at resources/stubs/seed.stub.

Thanks

Thanks to @bahri-hirfanoglu for PR #222.

v3.2.0

New Feature

  • --noregister option: Generate seed files without adding them to DatabaseSeeder.php. Useful for creating backup seeders or manually managing which seeders are registered.

Usage

php artisan iseed users --noregister

Thanks

Thanks to @VukTodorovic for the original PR #230 (renamed from --noseed to --noregister for clearer semantics).

v3.1.3

What's Changed

Small fixes and code quality improvements.

Changes

  • Use config() helper instead of \Config facade (#254) - @ChrisToxz
  • Fix typos in code and documentation (#242) - @szepeviktor
  • Fix docblocks and return type annotations (#244, #245) - @szepeviktor
  • Fix void return in handle() method (#243) - @szepeviktor
  • Fix README.md documentation (#229) - @VukTodorovic

Full Changelog: https://github.com/orangehill/iseed/compare/v3.1.2...v3.1.3

v3.1.2

What's Changed

Fixes #258 - php artisan iseed (without table names) now works on Laravel 11+.

Laravel 11 removed doctrine/dbal, so this release uses Laravel's Schema::getTables() facade instead.

Changes

  • Use Schema::getTables() for Laravel 11+ instead of doctrine/dbal
  • Support MySQL, SQLite, and PostgreSQL drivers
  • Fix PHP 8.2 dynamic property deprecation warning
  • Fix PHPUnit 8/11 test compatibility

Credits

Thanks to @zackAJ for identifying the issue and initial implementation (#259)

v3.1.1

Add Laravel 12 support

v3.1.0

v3.1.0 Release Notes

This release introduces significant improvements to the iSeed package functionality:

New Features

Optional Table Arguments

The tables argument is now optional in the iSeed command. When no specific tables are provided, the command will automatically generate seeders for all tables in your database.

php artisan iseed  # Seeds all tables
php artisan iseed my_table  # Seeds specific table

SQL WHERE Clause Support

Filter the rows to be included in the seed file using the --where option:

# Filter by email domain
php artisan iseed users --where="email LIKE '%[@example](https://github.com/example).com'"

# Filter by date and status
php artisan iseed users --where="active = 1 AND created_at > '2024-01-01'"

# Complex filtering with additional options
php artisan iseed users --where="role = 'admin'" --max=10 --orderby=created_at --direction=desc

Existing Features

You can still use all existing features including:

  • Specific table seeding with CSV notation: php artisan iseed my_table,another_table
  • Class name customization with prefixes/suffixes
  • Force overwrite option
  • Autoload control
  • Clean database seeder option

Requirements

  • Laravel 5.4 and above (auto-discovery supported)
  • PHP 7.0 and above

Installation

composer require orangehill/iseed
v3.0.4
v3.0.3
v3.0.2

Adds Laravel 9 support.

v3.0.1

Adds PHP8 support.

v3.0

This release aims to add a native laravel 8 support. To do this the following changes were made:

  1. Add namespace Database\Seeders; namespace to the seed stub.
  2. Change config to point to the default database/seeders/ directory over the laravel 7 database/seeds
  3. Change the Stubs directory to stubs

Since some breaking changes were introduced, the version is bumped to a major release.

v2.6.4

Added support for Laravel 8

v2.6.3

Added Laravel 7.0 support

v2.6.2
  • Added Laravel 6.0 support
  • Updated the documentation on how to use the orderby and direction parameters
v2.6.1

Added chunksize optional parameter which defines the size of data chunks for each insert query. Helps with issue described in https://github.com/orangehill/iseed/issues/4#issuecomment-380324859

v2.6

Optionally specify a prefix or suffix for the Seeder class name and file name. This is useful if you want to create an additional seed for a table that has an existing seed without overwriting the existing one.

v2.5.1

In order to support L55, the IseedCommand now has a handle() method for Laravel v5.5 and a fire() method for older Laravel versions.

https://github.com/laravel/framework/blob/master/CHANGELOG-5.5.md laravel/framework#19827 laravel/framework#20024

v2.5

By using --orderby and --direction parameters you can now set the column which will be used for results ordering, and the direction to order by (ASC/DESC). This works great when you want to limit the number of exported database entries using the --max parameter.

v2.4

By using --noindex the seed can be generated as a non-indexed array. The use case for this feature is when you need to merge two seed files.

v2.3.1
v2.3
  • Feature: Implemented a composer dump-autoload feature
  • Feature: Added the exclude columns functionality
  • Fix: iSeed is now using PHP_EOL instead of \r\n for line endings
  • Fix: Added a ::class notation to improve IDE navigation
  • Fix: Formated main class files as per PSR-2 standards
  • Fix: Fixed the failed table check issue when using multiple databases.
v2.2

Fixed a problem with query builder returning an object instead of an array.

v2.1

Added prerun and postrun command options; Formatted code according to PSR-2 standard; Updated documentation.

v2.0

Refactored code so that the package works with Laravel 5. If you want to use iSeed with Laravel 4, please use iSeed version 1.1.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport