alirezadp10/seeder

Improving seeding functionality of Laravel framework.

v1.0.0 2022-03-21 21:13 UTC

This package is not auto-updated.

Last update: 2022-07-31 00:13:22 UTC


README

Made Laravel Seeding More Useful

😞 Problem

Assume you have an application and in the middle of developing you should inject some data in your existing tables.

So you write your seeder and put insertion query and do your right thing and in the end you come to a question.

How run this seeder in different environments only once and not more?

The problem is this data should insert to all environments And you don't sure this seeder doesn't execute more than once.

💥 Solution

Seeder is a layer that changes Laravel seeding behavior slightly.

By the way, the seeding approach that is currently used in laravel, doesn't have support for seeding classes one time per running.

With this package you can define your seeders like before, but the task of executing them, is the responsibility of php artisan seed command.

By doing that you can put seed command in your CI configuration without worrying about some seeders execute several times.

📥 Installation

You can install the package via composer:

composer require alirezadp10/seeder

Create seeds table:

php artisan migrate

You can also migrate previous seeders file to new style if you want:

php artisan seeder:update

❗ Notice

After installing this package your seeder files generate like migration files, which you are already familiar with them.

License

MIT