2017 © Pedro Peláez
 

library laravel-seeder

Versioned, environment-based Seeders in Laravel

image

diegohq/laravel-seeder

Versioned, environment-based Seeders in Laravel

  • Monday, April 30, 2018
  • by diegohq
  • Repository
  • 1 Watchers
  • 0 Stars
  • 128 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 36 Forks
  • 0 Open issues
  • 18 Versions
  • 51 % Grown

The README.md

LaravelSeeder

Build Status, (*1)

Seeding as it is currently done in Laravel is intended only for dev builds, but what if you're iteratively creating your database and want to constantly flush it and repopulate it during development?, (*2)

What if you want to seed a production database with different data from what you use in development? What if you want to seed a table you've added to a database that is currently in production with new data?, (*3)

LaravelSeeder takes the database migration features in Laravel and extends them to database seeders, making them "migratable". All of the functionality you have grown accustomed to with Laravel migrations have been mirrored and behave similarly for seeders., (*4)

Requirements

  • Laravel >= 5.4
  • PHP >= 7.1

Installation

  • Run composer require eighty8/laravel-seeder
  • Add Eighty8\LaravelSeeder\SeederServiceProvider::class to your providers array in app/config/app.php
  • Run php artisan vendor:publish to push config files to your config folder if you want to override the name of the seeds folder or the name of the table where seeds are stored

Features

  • Allows you to seed databases in different environments with different values.
  • Allows you to "version" seeds the same way that Laravel currently handles migrations. Running php artisan seed will only run seeds that haven't already been run.
  • Allows you to run multiple seeds of the same model/table
  • Prompts you if your database is in production

Usage

When you install LaravelSeeder, various artisan commands are made available to you which use the same methodology you're used to using with Migrations., (*5)

seed Runs all the seeds in the "seeders" directory that haven't been run yet.
seed:rollback Rollback doesn't undo seeding (which would be impossible with an auto-incrementing primary key). It just allows you to re-run the last batch of seeds.
seed:reset Resets all the seeds.
seed:refresh Resets and re-runs all seeds.
seed:status Gets the status of each migratable seeder.
seed:make Makes a new seed class in the environment you specify.
seed:install You don't have to use this... it will be run automatically when you call "seed"

Local Development

A Dockerfile with PHP 7.2, XDebug and Composer installed is bundled with the project to facilitate local development., (*6)

To easily bring up the local development environment, use the Docker Compose configuration:, (*7)

docker-compose up -d --build

By default, the entrypoint script will install the Composer dependencies for you., (*8)

To run the test suite, execute the following:, (*9)

docker-compose exec laravel-seeder test.sh

To run the code coverage suite, execute the following:, (*10)

docker-compose exec laravel-seeder code-coverage.sh

Happy testing!, (*11)

The Versions

30/04 2018

dev-fork-pr

dev-fork-pr

Versioned, environment-based Seeders in Laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

database laravel table data environment seed version seeding seeder production staging

02/04 2018

dev-master

9999999-dev

Versioned, environment-based Seeders in Laravel while original repo is not updated for Laravel 5.6

  Sources   Download

MIT

The Requires

 

The Development Requires

database laravel table data environment seed version seeding seeder production staging

02/04 2018

5.6.1

5.6.1.0

Versioned, environment-based Seeders in Laravel while original repo is not updated for Laravel 5.6

  Sources   Download

MIT

The Requires

 

The Development Requires

database laravel table data environment seed version seeding seeder production staging

17/03 2018

5.6

5.6.0.0

Versioned, environment-based Seeders in Laravel while original repo is not updated for Laravel 5.6

  Sources   Download

MIT

The Requires

 

The Development Requires

database laravel table data environment seed version seeding seeder production staging

16/01 2018

5.5.1

5.5.1.0

Versioned, environment-based Seeders in Laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

database laravel table data environment seed version seeding seeder production staging

06/11 2017

dev-develop

dev-develop

Versioned, environment-based Seeders in Laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

database laravel table data environment seed version seeding seeder production staging

06/11 2017

5.5.0

5.5.0.0

Versioned, environment-based Seeders in Laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

database laravel table data environment seed version seeding seeder production staging

28/06 2017

5.4.x-dev

5.4.9999999.9999999-dev

Versioned, environment-based Seeders in Laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

database laravel table data environment seed version seeding seeder production staging

28/06 2017

5.4.4

5.4.4.0

Versioned, environment-based Seeders in Laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

database laravel table data environment seed version seeding seeder production staging

28/06 2017

5.4.3

5.4.3.0

Versioned, environment-based Seeders in Laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

database laravel table data environment seed version seeding seeder production staging

28/06 2017

5.4.2

5.4.2.0

Versioned, environment-based Seeders in Laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

database laravel table data environment seed version seeding seeder production staging

28/06 2017

5.4.1

5.4.1.0

Versioned, environment-based Seeders in Laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

database laravel table data environment seed version seeding seeder production staging

28/06 2017

5.4.0

5.4.0.0

Versioned, environment-based Seeders in Laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

database laravel table data environment seed version seeding seeder production staging

24/03 2016

5.2.5

5.2.5.0

Smart seeders for Laravel.

  Sources   Download

MIT

The Requires

 

The Development Requires

database laravel table smart seed seeding seeder

24/03 2016

5.2.4

5.2.4.0

Smart seeders for Laravel.

  Sources   Download

MIT

The Requires

 

The Development Requires

database laravel table smart seed seeding seeder

17/03 2016

5.2.2

5.2.2.0

Smart seeders for Laravel.

  Sources   Download

MIT

The Requires

 

The Development Requires

database laravel table smart seed seeding seeder

17/03 2016

5.2.1

5.2.1.0

Smart seeders for Laravel.

  Sources   Download

MIT

The Requires

 

The Development Requires

database laravel table smart seed seeding seeder

17/03 2016

5.2.0

5.2.0.0

Smart Seeder adds the same methology to seeding that is currently used with migrations in order to let you seed in batches, seed to production databases or other environments, and to rerun seeds without wiping out your data.

  Sources   Download

MIT

The Requires

 

The Development Requires

database laravel table smart seed seeding seeder