Module - How to seed data?
Created 1 year ago by marceauka

Hi, I'm building a module with a stream. There's no documentation about seeding. I've try this in my CategorySeeder.php:

    protected $data = [
            'name' => 'Foo',
            'slug' => 'foo'
        // ...

    public function run()
        // "categories" is CategoryRepositoryInterface

        foreach ($this->data as $data) {

But when I call artisan addon:reinstall --seed nothing happens.

ryanthompson  —  1 year ago

Close! Make sure your addon seeder is calling the subsequent stream seeders like this:

marceauka  —  1 year ago

Yeah, it works! Thank you ;p