mirror of
https://github.com/barryvdh/laravel-ide-helper.git
synced 2026-08-17 17:47:13 +00:00
New --write-mixin option. (#764)
* New --write-mixin option. * Keep all tags from the existing docblock. * Update argument description to be more descriptive Co-authored-by: Markus Podar <[email protected]> * Add the new --write-mixin option to the docs * Add test for the new --write-mixin option * Update README.md * composer fix-style * Adapt test after refactoring recently done Co-authored-by: Markus Podar <[email protected]>
This commit is contained in:
co-authored by
Markus Podar
parent
d978986523
commit
24596b67f1
@@ -121,6 +121,10 @@ By default, you are asked to overwrite or write to a separate file (`_ide_helper
|
||||
You can write the comments directly to your Model file, using the `--write (-W)` option, or
|
||||
force to not write with `--nowrite (-N)`.
|
||||
|
||||
Alternatively using the `--write-mixin (-M)` option will only add a mixin tag to your Model file,
|
||||
writing the rest in (`_ide_helper_models.php`).
|
||||
The class name will be different from the model, avoiding the IDE duplicate annoyance.
|
||||
|
||||
> Please make sure to back up your models, before writing the info.
|
||||
|
||||
Writing to the models should keep the existing comments and only append new properties/methods.
|
||||
@@ -151,6 +155,14 @@ php artisan ide-helper:models "App\Models\Post"
|
||||
*/
|
||||
```
|
||||
|
||||
With the `--write-mixin (-M)` option
|
||||
```php
|
||||
/**
|
||||
* …
|
||||
* @mixin IdeHelperPost
|
||||
*/
|
||||
```
|
||||
|
||||
By default, models in `app/models` are scanned. The optional argument tells what models to use (also outside app/models).
|
||||
|
||||
```bash
|
||||
|
||||
Reference in New Issue
Block a user