From 573d55c9b219175ce7884a1ea76ef54b8301b9b8 Mon Sep 17 00:00:00 2001 From: Josiah Dahl Date: Mon, 7 Aug 2017 11:51:43 -0700 Subject: [PATCH] updated README --- README.md | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 12b54cc..615e3c3 100644 --- a/README.md +++ b/README.md @@ -509,7 +509,9 @@ The second command is `wn:controller` which actually generates the controller. T - **--no-routes**: Since routes are generated by default for the controller, this option is used to tell the generator "do not generate routes !". -- **--force**: tells the generator to override the existing file. +- **--force**: tells the generator to override the existing file. + +- **--laravel**: create Laravel style routes `php artisan wn:controller Task --no-routes` gives: @@ -539,6 +541,9 @@ The `wn:route` command is used to generate RESTfull routes for a controller. It - **--force**: tells the generator to override the existing file. +- **--laravel**: create Laravel style routes + + `php artisan wn:route project-type` adds the following routes: ```php @@ -549,6 +554,17 @@ $app->put('project-type/{id}', 'ProjectTypesController@put'); $app->delete('project-type/{id}', 'ProjectTypesController@remove'); ``` + +`php artisan wn:route project-type --laravel` adds the following routes: + +```php +Route::get('project-type', 'ProjectTypesController@all'); +Route::get('project-type/{id}', 'ProjectTypesController@get'); +Route::post('project-type', 'ProjectTypesController@add'); +Route::put('project-type/{id}', 'ProjectTypesController@put'); +Route::delete('project-type/{id}', 'ProjectTypesController@remove'); +``` + ### Resource Generator The `wn:resource` command makes it very easy to generate a RESTful resource. It generates a model, migration, controller and routes. The syntax is : `wn:resource name fields [--add=...] [--has-many=...] [--has-one=...] [--belongs-to=...] [--migration-file=...] [--path=...] [--force=true]` @@ -581,6 +597,9 @@ The `wn:resource` command makes it very easy to generate a RESTful resource. It - **--force**: tells the generator to override the existing file. +- **--laravel**: create Laravel style routes + + ### Multiple Resources From File The `wn:resources` (note the "s" in "resources") command takes the generation process to an other level by parsing a file and generating multiple resources based on it. The syntax is @@ -595,6 +614,9 @@ The file given to the command should be a valid YAML file ( for the moment, supp - **--path**: Defines where to store the model files as well as their namespace. +- **--laravel**: create Laravel style routes + + ```yaml --- Store: