Skip to content

Latest commit

 

History

History
88 lines (60 loc) · 1.99 KB

File metadata and controls

88 lines (60 loc) · 1.99 KB

Manage seeders like migrations

Latest Version on Packagist Total Downloads

This package allows you to manage your seeders like migrations. You can run and will not run again.

I'm working on more features like rollback and more. Total WIP.

Installation

You can install the package via composer:

composer require curicows/laravel-seeder-manager

Usage

Seed a database with a seeder interface:

class DataSeeder extends Seeder implements SeedDatabase
{
    public function getName(): string
    {
        return 'DataSeeder';
    }

    public function seed(): void
    {
        User::create([
            'name' => 'Admin',
            'email' => 'test@test.com',
        ]);
    }
}

Or a manager to handle multiple seeders:

class DataManagerSeeder extends Seeder implements ManagerSeeder
{
    public function getName(): string
    {
        return 'DataManagerSeeder';
    }

    public function getSeeders(): array
    {
        return [
            DataSeeder::class,
        ];
    }
}

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email curicows@curicows.com instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.