PHPackages                             msml/generators - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. msml/generators

AbandonedArchivedLibrary[Utility &amp; Helpers](/categories/utility)

msml/generators
===============

Extend Laravel 5's generators.

1.2.3(8y ago)03.2kMITPHPPHP &gt;=5.4.0

Since Feb 26Pushed 8y ago2 watchersCompare

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

READMEChangelogDependencies (2)Versions (14)Used By (0)

Fork Laravel (Extended) Generators
==================================

[](#fork-laravel-extended-generators)

[![Build Status](https://camo.githubusercontent.com/46b905403ba243610c689f5743a4eae0a15270ccd421c32cad2d52c2719b241c/68747470733a2f2f7472617669732d63692e6f72672f6c61726163617374732f4c61726176656c2d352d47656e657261746f72732d457874656e6465642e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/laracasts/Laravel-5-Generators-Extended)

If you're familiar with my [Laravel 4 Generators](https://github.com/JeffreyWay/Laravel-4-Generators), then this is basically the same thing - just upgraded for Laravel 5.

L5 includes a bunch of generators out of the box, so this package only needs to add a few things, like:

- `make:migration:schema`
- `make:migration:pivot`
- `make:seed`

*With one or two more to come.*

Usage on Laravel 5.5
--------------------

[](#usage-on-laravel-55)

### Step 1: Install Through Composer

[](#step-1-install-through-composer)

```
composer require msml/generators --dev

```

### Step 2: Run Artisan!

[](#step-2-run-artisan)

You're all set. Run `php artisan` from the console, and you'll see the new commands in the `make:*` namespace section.

Usage on Laravel 5.4 and 5.3
----------------------------

[](#usage-on-laravel-54-and-53)

### Step 1: Install Through Composer

[](#step-1-install-through-composer-1)

```
composer require msml/generators --dev

```

### Step 2: Add the Service Provider

[](#step-2-add-the-service-provider)

You'll only want to use these generators for local development, so you don't want to update the production `providers` array in `config/app.php`. Instead, add the provider in `app/Providers/AppServiceProvider.php`, like so:

```
public function register()
{
	if ($this->app->environment() == 'local') {
		$this->app->register('MSML\Generators\GeneratorsServiceProvider');
	}
}
```

### Step 3: Run Artisan!

[](#step-3-run-artisan)

You're all set. Run `php artisan` from the console, and you'll see the new commands in the `make:*` namespace section.

Examples
--------

[](#examples)

- [Migrations With Schema](#migrations-with-schema)
- [Pivot Tables](#pivot-tables)
- [Database Seeders](#database-seeders)

### Migrations With Schema

[](#migrations-with-schema)

```
php artisan make:migration:schema create_users_table --schema="username:string, email:string:unique"

```

Notice the format that we use, when declaring any applicable schema: a comma-separate list...

```
COLUMN_NAME:COLUMN_TYPE

```

So any of these will do:

```
username:string
body:text
age:integer
published_at:date
excerpt:text:nullable
email:string:unique:default('foo@example.com')

```

Using the schema from earlier...

```
--schema="username:string, email:string:unique"

```

...this will give you:

```
