From c760c9aa0c067fd8dec67c6759cd6c6827e8d8b2 Mon Sep 17 00:00:00 2001 From: Markus Podar Date: Thu, 20 Aug 2020 21:57:11 +0200 Subject: [PATCH] readme: be clear that models require FQN (#1012) I've tested this and yes, it *always* requires a FQN. Therefore I removed the extra note regarding namespace/wrapping because even by default Laravel has the `App\` namesapce, which requires this. Fixes https://github.com/barryvdh/laravel-ide-helper/issues/995 --- README.md | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 5fe83bb..de3e95c 100644 --- a/README.md +++ b/README.md @@ -128,7 +128,7 @@ The existing PHPDoc is replaced, or added if not found. With the `--reset (-R)` option, the existing PHPDocs are ignored, and only the newly found columns/relations are saved as PHPDocs. ```bash -php artisan ide-helper:models Post +php artisan ide-helper:models "App\Models\Post" ``` ```php @@ -154,7 +154,7 @@ php artisan ide-helper:models Post By default, models in `app/models` are scanned. The optional argument tells what models to use (also outside app/models). ```bash -php artisan ide-helper:models Post User +php artisan ide-helper:models "App\Models\Post" "App\Models\User" ``` You can also scan a different directory, using the `--dir` option (relative from the base path): @@ -168,20 +168,18 @@ You can publish the config file (`php artisan vendor:publish`) and set the defau Models can be ignored using the `--ignore (-I)` option ```bash -php artisan ide-helper:models --ignore="Post,User" +php artisan ide-helper:models --ignore="App\Models\Post,App\Models\User" ``` Or can be ignored by setting the `ignored_models` config ```php 'ignored_models' => [ - Post::class, + App\Post::class, Api\User::class ], ``` -> Note: With namespaces, wrap your model name in double-quotes (`"`): `php artisan ide-helper:models "API\User"`, or escape the slashes (`Api\\User`). - #### Magic `where*` methods Eloquent allows calling `where` on your modes, e.g. `Post::whereTitle(…)` and automatically translates this to e.g. `Post::where('title', '=', '…')`.