Module - How to seed data?
Created 6 years 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  —  6 years ago

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

marceauka  —  6 years ago

Yeah, it works! Thank you ;p