mirror of
https://github.com/ZorgCC/lumen-generators.git
synced 2024-12-26 14:05:29 +03:00
updated README
This commit is contained in:
parent
a951151697
commit
573d55c9b2
24
README.md
24
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 !".
|
- **--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:
|
`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.
|
- **--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 artisan wn:route project-type` adds the following routes:
|
||||||
|
|
||||||
```php
|
```php
|
||||||
@ -549,6 +554,17 @@ $app->put('project-type/{id}', 'ProjectTypesController@put');
|
|||||||
$app->delete('project-type/{id}', 'ProjectTypesController@remove');
|
$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
|
### 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]`
|
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.
|
- **--force**: tells the generator to override the existing file.
|
||||||
|
|
||||||
|
- **--laravel**: create Laravel style routes
|
||||||
|
|
||||||
|
|
||||||
### Multiple Resources From File
|
### 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
|
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.
|
- **--path**: Defines where to store the model files as well as their namespace.
|
||||||
|
|
||||||
|
- **--laravel**: create Laravel style routes
|
||||||
|
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
---
|
---
|
||||||
Store:
|
Store:
|
||||||
|
Loading…
Reference in New Issue
Block a user