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

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

oscarafdev/laravel-4-generators
===============================

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

12.0.0(5mo ago)5588.7k↓12.6%111MITPHPPHP ^8.3

Since Apr 19Pushed 5mo agoCompare

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

READMEChangelog (10)Dependencies (8)Versions (36)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`

Version compatibility &amp; branches
------------------------------------

[](#version-compatibility--branches)

Branch / TagLaravel supportPHP supportNotes`laravel-12.x` (tag `12.0.0`)12.x&gt;= 8.3Install via `composer require oscarafdev/laravel-4-generators:^12.0`.`laravel-11.x` (tag `11.0.0`)11.x&gt;= 8.2Install via `composer require oscarafdev/laravel-4-generators:^11.0`.`laravel-10.x` (tag `10.0.0`)10.x&gt;= 8.1Install via `composer require oscarafdev/laravel-4-generators:^10.0`.`laravel-9.x` (tag `9.0.0`)9.x&gt;= 8.0.2Use `^9.0` for Laravel 9 projects.Legacy `2.x` (tag `2.0.24`)5.x - 8.x^5.6 || ^7.0 || ^8.0Last release supporting older Laravel versions.We keep a dedicated branch per major Laravel line. Active development happens on the highest `laravel-.x` branch (currently `laravel-12.x`), while the previous branches stay available for backports. If you need to patch an older release, check out the matching branch and publish a new `x.y.z` tag that mirrors the Laravel major version you are targeting (e.g. `10.1.0` for Laravel 10 maintenance).

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

```
