mirror of
https://github.com/barryvdh/laravel-ide-helper.git
synced 2026-08-18 01:57:13 +00:00
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
This commit is contained in:
@@ -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<Attribute>` on your modes, e.g. `Post::whereTitle(…)` and automatically translates this to e.g. `Post::where('title', '=', '…')`.
|
||||
|
||||
Reference in New Issue
Block a user