PHPackages                             mdsys/laravel\_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. mdsys/laravel\_generators

ActiveLibrary

mdsys/laravel\_generators
=========================

Laravel 4 Generators

1.0(13y ago)022PHPPHP &gt;=5.3.0

Since Apr 19Pushed 12y ago1 watchersCompare

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

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

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

- `generate:model`
- `generate:controller`
- `generate:seed`
- `generate:view`
- `generate:migration`
- `generate:resource`
- `generate:scaffold`
- `generate:form`
- `generate:test`
- `generate:pivot` &lt;-- NEW!!

Prefer a Video Walk-through?
----------------------------

[](#prefer-a-video-walk-through)

[See here.](http://tutsplus.s3.amazonaws.com/tutspremium/courses_$folder$/WhatsNewInLaravel4/9-Generators.mp4)

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

[](#installation)

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

```
"require": {
	"laravel/framework": "4.0.*",
	"way/generators": "dev-master"
},
"minimum-stability" : "dev"

```

Next, update Composer from the Terminal:

```
composer update

```

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

```

> There's also a [Sublime Text plugin available](http://net.tutsplus.com/tutorials/tools-and-tips/pro-workflow-in-laravel-and-sublime-text/) to assist with the generators. Definitely use it, but not before you learn the syntax below.

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)
- [Resources](#resources)
- [Scaffolding](#scaffolding)
- [Forms](#forms)
- [Tests](#tests)
- [Pivot Tables](#pivot-tables)

### Migrations

[](#migrations)

Laravel 4 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`.

```
