Skip to content

Commit

Permalink
Merge
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffreyWay committed Oct 1, 2014
2 parents 1fb22e0 + 14a9fd9 commit ecd8910
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 12 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
],
"require": {
"php": ">=5.4.0",
"illuminate/support": "~4.0"
"illuminate/support": "~5.0"
},
"require-dev": {
"phpspec/phpspec": "~2.0",
Expand Down
4 changes: 2 additions & 2 deletions provides.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"providers": [
"Way\Generators\GeneratorsServiceProvider"
"Way\\Generators\\GeneratorsServiceProvider"
]
}
}
34 changes: 28 additions & 6 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![Build Status](https://travis-ci.org/JeffreyWay/Laravel-4-Generators.png?branch=master)](https://travis-ci.org/JeffreyWay/Laravel-4-Generators)

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

- `generate:model`
- `generate:view`
Expand All @@ -17,20 +17,42 @@ This Laravel 4 package provides a variety of generators to speed up your develop

> [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

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

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

> Version 3 of these generators works with Laravel 4.3. Because the folder structure is different, if you are still on 4.2 or below, instead, pull in `~2.0`.
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

## Laravel 5.0 and Above

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

"require-dev": {
"way/generators": "~3.0"
}

> Version 3 of these generators works with Laravel 5.0 and higher, due to the new default folder structure in Laravel.
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.
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'

Expand All @@ -53,7 +75,7 @@ Think of generators as an easy way to speed up your workflow. Rather than openin

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

Expand Down Expand Up @@ -281,7 +303,7 @@ This command will create an empty view, `/app/views/admin/reports/index.blade.ph

### Seeds

Laravel 4 provides us with a flexible way to seed new tables.
Laravel provides us with a flexible way to seed new tables.

php artisan generate:seed users

Expand Down
2 changes: 1 addition & 1 deletion src/Way/Generators/templates/model.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ class $NAME$ extends Model {

protected $fillable = [];

}
}
2 changes: 1 addition & 1 deletion src/Way/Generators/templates/scaffolding/model.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ class $NAME$ extends Model {

protected $fillable = [];

}
}
1 change: 1 addition & 0 deletions src/Way/Generators/templates/seed.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

// Composer: "fzaninotto/faker": "v1.4.0"
use Faker\Factory as Faker;
use Illuminate\Database\Seeder;

class $CLASS$ extends Seeder {

Expand Down
2 changes: 1 addition & 1 deletion tests/stubs/Order.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ class Order extends Model {

protected $fillable = [];

}
}

0 comments on commit ecd8910

Please sign in to comment.