Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[12.x] feat(seed): Add multiple seeder support with enhanced validation #55949

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: 12.x
Choose a base branch
Loading
from

Conversation

sulabh-npl
Copy link

Description

This PR significantly enhances the db:seed command with two major improvements:

  1. Multiple Seeder Support: Ability to run multiple seeders in a single command
  2. Validation Layer: Comprehensive pre-execution checks for seeder integrity

Changes

1. Multiple Seeder Implementation

Core Changes:

  • Modified argument/option handling from singular class to plural classes
  • Updated method signatures and help texts to reflect new capability
  • Implemented array processing for multiple classes:
    $classes = $this->input->getArgument('classes') ?? $this->input->getOption('classes');
    foreach (explode(',', $classes) as $class) {
        $class = trim($class);
        // Namespace handling and validation
    }

Sulabh Nepal added 3 commits June 8, 2025 00:06
-
- Added support for comma-separated seeder classes in single 'class' parameter
- Implemented strict validation in resolveSeeder() method:
  • Class existence checking
  • Proper Seeder inheritance verification
  • Required run() method validation
- Improved error handling with exit(1) on validation failures
- Maintained backward compatibility with single seeder usage
- Cleaned up code structure with dedicated resolver method
- Updated help texts to reflect multiple seeder capability
-
- The changes enable running multiple seeders while preventing common errors
@shaedrich
Copy link
Contributor

Have you considered defining the argument/option as an array right away instead?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.