PHPackages                             reedware/laravel-seeders - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. reedware/laravel-seeders

ActiveLibrary

reedware/laravel-seeders
========================

Adds the ability to generate and seed from seed data.

v1.0.1(2y ago)14MITPHPPHP ^8.0

Since Jun 26Pushed 2y ago1 watchersCompare

[ Source](https://github.com/tylernathanreed/laravel-seeders)[ Packagist](https://packagist.org/packages/reedware/laravel-seeders)[ RSS](/packages/reedware-laravel-seeders/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (8)Versions (3)Used By (0)

Laravel Seeders
===============

[](#laravel-seeders)

This package adds the ability to generate and seed from seed data.

[![Laravel Version](https://camo.githubusercontent.com/f2cb758485cda6b90d7564e4d6ddab7a3de35a4814167b554f03a8e4bef79280/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c2d392e7825324631302e782d626c7565)](https://laravel.com/)[![Automated Tests](https://github.com/tylernathanreed/laravel-seeders/actions/workflows/tests.yml/badge.svg)](https://github.com/tylernathanreed/laravel-seeders/actions/workflows/tests.yml)[![Coding Standards](https://github.com/tylernathanreed/laravel-seeders/actions/workflows/coding-standards.yml/badge.svg)](https://github.com/tylernathanreed/laravel-seeders/actions/workflows/coding-standards.yml)[![Static Analysis](https://github.com/tylernathanreed/laravel-seeders/actions/workflows/static-analysis.yml/badge.svg)](https://github.com/tylernathanreed/laravel-seeders/actions/workflows/static-analysis.yml)[![Latest Stable Version](https://camo.githubusercontent.com/6db133a74cdc1aace24e2f940285dcbece78316aed54b5b3cc68c102fbb31f04/68747470733a2f2f706f7365722e707567782e6f72672f72656564776172652f6c61726176656c2d736565646572732f762f737461626c65)](https://packagist.org/packages/reedware/laravel-seeders)

Introduction
------------

[](#introduction)

Seeders in Laravel are great for seeding fake data, but that's not their only use case. Seeders are also often used for seeding the boilerplate application data used in glossary type tables (e.g. enumerables, drop-down options, etc.), or tables managed by developers (e.g. roles, permissions, etc.). However, when seeding boilerplate data, there can be a number of complications that arise over time. This package aims to provide seeding application data, and solves the following complications that come with it:

- You want to seed an initial data set, and let the application manage the rest
- You want to seed an initial data set, occasional new entries, and let the application manage the rest
- You want the seeders to have full control over a table
- You want to manage a table through seeding, except for a few columns

Installation
------------

[](#installation)

### Composer

[](#composer)

This package can be installed using composer:

```
composer require reedware/laravel-seeders

```

### Service Provider

[](#service-provider)

This package uses auto-discovery to register its service provider. If you choose to manually register the provider, here's the full class path:

```
'providers' => [
    /* ... */
    Reedware\LaravelSeeders\SeederServiceProvider::class
    /* ... */
]
```

### Facade

[](#facade)

This package uses auto-discover to register its facade. If you choose to manually register the facade, here's the default binding:

```
'aliases' => [
    'Seed' => Reedware\LaravelSeeders\Seed::class
]
```

If you wish to avoid using the facade, you can obtain the underlying instance through the IoC Container:

```
app('db.seed')
// or
app(Reedware\LaravelSeeders\Contracts\Factory::class)
```

Usage
-----

[](#usage)

### Basic Example

[](#basic-example)

To create your first seeder, start by creating a new seeder like so:

```
