PHPackages                             digital-drifter/laravel-cli-seeder - 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. digital-drifter/laravel-cli-seeder

ActiveLibrary

digital-drifter/laravel-cli-seeder
==================================

Generate schema based test data from the cli.

012PHP

Since Jul 2Pushed 7y ago1 watchersCompare

[ Source](https://github.com/digital-drifter/laravel-cli-seeder)[ Packagist](https://packagist.org/packages/digital-drifter/laravel-cli-seeder)[ RSS](/packages/digital-drifter-laravel-cli-seeder/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Laravel CLI Seeder
==================

[](#laravel-cli-seeder)

A (semi) intelligent utility to generate test data quickly.

About
=====

[](#about)

The idea behind this package is generate test data based on a table that acts as the central reference point. Often times, applications will have a table that effectively serves as the root node for a relationship graph. For example, a typical multi-tenancy application will define a tenants, accounts, customers, etc. table which other tables define a foreign relationship with.

Using `tenants` as the example table, there could be `users`, `settings`, and `posts` tables which each have a `tenant_id`. By setting the `Tenant` model as the parent model in the configuration, this package will query for all `tenants` and prompt to select one for the generation process. Anytime a column name `tenant_id` is encountered, the selected `tenant`'s primary key will be used.

In addition, when other foreign keys are detected, it will attempt to only use those which are assigned to the `tenant`, as well.

Installation
============

[](#installation)

```
composer require digital-drifter/laravel-cli-seeder
```

Usage
=====

[](#usage)

```
php artisan cli-seeder:generate
```

Configuration
=============

[](#configuration)

> config/cli-seeder.php

```
