mirror of
https://github.com/ZorgCC/lumen-generators.git
synced 2024-12-27 06:25:28 +03:00
updated README
This commit is contained in:
parent
a951151697
commit
573d55c9b2
22
README.md
22
README.md
@ -511,6 +511,8 @@ The second command is `wn:controller` which actually generates the controller. T
|
|||||||
|
|
||||||
- **--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