Skip to content

Commit

Permalink
Fix namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
sohelamin committed Sep 17, 2020
1 parent 6c4082e commit 0e41ccc
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions doc/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
### CRUD Command

```
php artisan crud:generate Posts --fields='title#string; content#text; category#select#options={"technology": "Technology", "tips": "Tips", "health": "Health"}' --view-path=admin --controller-namespace=Admin --route-group=admin --form-helper=html
php artisan crud:generate Posts --fields='title#string; content#text; category#select#options={"technology": "Technology", "tips": "Tips", "health": "Health"}' --view-path=admin --controller-namespace=App\\Http\\Controllers\\Admin --route-group=admin --form-helper=html
```

#### CRUD fields from a JSON file:
Expand Down Expand Up @@ -45,7 +45,7 @@ php artisan crud:generate Posts --fields='title#string; content#text; category#s
{
"name": "user",
"type": "belongsTo",
"class": "App\\User"
"class": "App\\Models\\User"
}
],
"validations": [
Expand All @@ -58,7 +58,7 @@ php artisan crud:generate Posts --fields='title#string; content#text; category#s
```

```
php artisan crud:generate Posts --fields_from_file="/path/to/fields.json" --view-path=admin --controller-namespace=Admin --route-group=admin --form-helper=html
php artisan crud:generate Posts --fields_from_file="/path/to/fields.json" --view-path=admin --controller-namespace=App\\Http\\Controllers\\Admin --route-group=admin --form-helper=html
```

### Other Commands
Expand Down
2 changes: 1 addition & 1 deletion src/Commands/CrudApiCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public function handle()
$perPage = intval($this->option('pagination'));

$controllerNamespace = ($this->option('controller-namespace')) ? $this->option('controller-namespace') . '\\' : '';
$modelNamespace = ($this->option('model-namespace')) ? trim($this->option('model-namespace')) . '\\' : '';
$modelNamespace = ($this->option('model-namespace')) ? trim($this->option('model-namespace')) . '\\' : 'Models\\';

$fields = rtrim($this->option('fields'), ';');

Expand Down
2 changes: 1 addition & 1 deletion src/Commands/CrudCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public function handle()
$perPage = intval($this->option('pagination'));

$controllerNamespace = ($this->option('controller-namespace')) ? $this->option('controller-namespace') . '\\' : '';
$modelNamespace = ($this->option('model-namespace')) ? trim($this->option('model-namespace')) . '\\' : '';
$modelNamespace = ($this->option('model-namespace')) ? trim($this->option('model-namespace')) . '\\' : 'Models\\';

$fields = rtrim($this->option('fields'), ';');

Expand Down

0 comments on commit 0e41ccc

Please sign in to comment.