Skip to content

Flexible Table Selection and SQL Filtering Support

Latest
Compare
Choose a tag to compare
@tihomiro tihomiro released this 13 Feb 11:26
· 1 commit to master since this release

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