marceauka - 6 months ago

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
        $this->categories->truncate();

        foreach ($this->data as $data) {
            $this->categories->create($data);
        }
    }

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

ryanthompson - 6 months ago

Close! Make sure your addon seeder is calling the subsequent stream seeders like this: https://github.com/anomalylabs/pages-module/tree/2.3/src

marceauka - 6 months ago

Yeah, it works! Thank you ;p