Skip to content

[feat] Multiple records in __seeder()#1

Open
eminsr wants to merge 1 commit into
leafsphp:mainfrom
eminsr:patch-1
Open

[feat] Multiple records in __seeder()#1
eminsr wants to merge 1 commit into
leafsphp:mainfrom
eminsr:patch-1

Conversation

@eminsr

@eminsr eminsr commented Jan 26, 2026

Copy link
Copy Markdown

Currently the __seeder() only accepts single record with this if __seeder() returns an array of records all records will be accepted.

What kind of change does this PR introduce? (pls check at least one)

  • Bugfix
  • Feature
  • Code style update
  • Refactor
  • Build-related changes
  • Other, please describe below

Description

From Model's __seeder() function seeding multiple records wasn't possible so this PR adds that functionality.

namespace App\Models;

class Name extends Model
{
    public static function __seeder(){
        return [
            [
                'name' => 'First',
            ],
            [
                'name' => 'Second',
            ],
            [
                'name' => 'Third',
            ],
        ];
    }
}

Does this PR introduce a breaking change? (check one)

  • Yes
  • No

Related Issue

Currently the __seeder() only accepts single record with this if __seeder() returns an array of records all records will be accepted.
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.

1 participant