---
title: Seeding
---

# Seeding

<div class="documentation__toc"></div>

## Introduction

In general seeders in the Streams Platform work just like [seeders in Laravel](https://laravel.com/docs/seeding).

## Creating Seeders

You can create a simple seeder like so:

```php
<?php namespace Anomaly\ExampleModule;

use Anomaly\Streams\Platform\Database\Seeder\Seeder;
use Example\TestModule\Widget\Contract\WidgetRepositoryInterface;

class ExampleModuleSeeder extends Seeder
{

    protected $widgets;

    public function __construct(WidgetRepositoryInterface $widgets)
    {
        $this->widgets = $widgets;
    }

    public function run()
    {
        $this->widgets->create(
            [
                'en'           => [
                    'name' => 'Welcome',
                ],
                'slug'         => 'welcome',
                'enabled'      => true,
                'price'        => 100,
            ]
        );
    }
}
```

## Running Seeders

You can run seeders in addons by providing the `--addon` option.

```bash
php artisan db:seed --addon=example.module.test
```
