PHPackages                             liudaved/laravel-4-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. liudaved/laravel-4-generators

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

liudaved/laravel-4-generators
=============================

Rapidly generate resources, migrations, models, and much more.

4.0.1(5y ago)0121MITPHPPHP &gt;=7.2.0

Since Apr 19Pushed 5y agoCompare

[ Source](https://github.com/liudaved/Laravel-4-Generators)[ Packagist](https://packagist.org/packages/liudaved/laravel-4-generators)[ RSS](/packages/liudaved-laravel-4-generators/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (8)Versions (21)Used By (1)

Fast Workflow in Laravel With Custom Generators
===============================================

[](#fast-workflow-in-laravel-with-custom-generators)

[![Build Status](https://camo.githubusercontent.com/7941578b818f42aa552ce91b144a78223cabcc5cf97cf3169f01dc2c0e2d59a8/68747470733a2f2f7472617669732d63692e6f72672f4a6566667265795761792f4c61726176656c2d342d47656e657261746f72732e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/JeffreyWay/Laravel-4-Generators)

This Laravel package provides a variety of generators to speed up your development process. These generators include:

- `generate:model`
- `generate:view`
- `generate:controller`
- `generate:seed`
- `generate:migration`
- `generate:pivot`
- `generate:resource`
- `generate:scaffold`

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

[](#installation)

> [Want a 5-minute video overview?](https://dl.dropboxusercontent.com/u/774859/Work/Laravel-4-Generators/Get-Started-With-Laravel-Custom-Generators.mp4)

Laravel 4.2 and Below
---------------------

[](#laravel-42-and-below)

Begin by installing this package through Composer. Edit your project's `composer.json` file to require `way/generators`.

```
"require-dev": {
	"way/generators": "~2.0"
}

```

> There is no support for Laravel 5, as the framework now includes a number of generators out of the box.

Next, update Composer from the Terminal:

```
composer update --dev

```

Once this operation completes, the final step is to add the service provider. Open `app/config/app.php`, and add a new item to the providers array.

```
'Way\Generators\GeneratorsServiceProvider'

```

That's it! You're all set to go. Run the `artisan` command from the Terminal to see the new `generate` commands.

```
php artisan

```

Next, update Composer from the Terminal:

```
composer update --dev

```

Once this operation completes, the final step is to add the service provider. Open `config/app.php`, and add a new item to the providers array.

```
'Way\Generators\GeneratorsServiceProvider'

```

That's it! You're all set to go. Run the `artisan` command from the Terminal to see the new `generate` commands.

```
php artisan

```

Usage
-----

[](#usage)

Think of generators as an easy way to speed up your workflow. Rather than opening the models directory, creating a new file, saving it, and adding the class, you can simply run a single generate command.

- [Migrations](#migrations)
- [Models](#models)
- [Views](#views)
- [Seeds](#seeds)
- [Pivot](#pivot)
- [Resources](#resources)
- [Scaffolding](#scaffolding)
- [Configuration](#configuration)

### Migrations

[](#migrations)

Laravel offers a migration generator, but it stops just short of creating the schema (or the fields for the table). Let's review a couple examples, using `generate:migration`.

```
php artisan generate:migration create_posts_table

```

If we don't specify the `fields` option, the following file will be created within `app/database/migrations`.

```
