diff --git a/src/Console/ModelsCommand.php b/src/Console/ModelsCommand.php index c6fe186..c117310 100644 --- a/src/Console/ModelsCommand.php +++ b/src/Console/ModelsCommand.php @@ -1225,7 +1225,7 @@ class ModelsCommand extends Command ; $className = trim($className, '\\'); - $writingToExternalFile = !$this->write; + $writingToExternalFile = !$this->write || $this->write_mixin; $classIsNotInExternalFile = $reflection->getName() !== $className; $forceFQCN = $this->laravel['config']->get('ide-helper.force_fqn', false); diff --git a/tests/Console/ModelsCommand/GeneratePhpdocWithMixin/Models/Post.php b/tests/Console/ModelsCommand/GeneratePhpdocWithMixin/Models/Post.php index 24d6981..7817bed 100644 --- a/tests/Console/ModelsCommand/GeneratePhpdocWithMixin/Models/Post.php +++ b/tests/Console/ModelsCommand/GeneratePhpdocWithMixin/Models/Post.php @@ -5,6 +5,7 @@ declare(strict_types=1); namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GeneratePhpdocWithMixin\Models; use Illuminate\Database\Eloquent\Model; +use Illuminate\Database\Eloquent\Builder; /** * @property $someProp diff --git a/tests/Console/ModelsCommand/GeneratePhpdocWithMixin/__snapshots__/Test__test__1.php b/tests/Console/ModelsCommand/GeneratePhpdocWithMixin/__snapshots__/Test__test__1.php index 872469a..ac0fea8 100644 --- a/tests/Console/ModelsCommand/GeneratePhpdocWithMixin/__snapshots__/Test__test__1.php +++ b/tests/Console/ModelsCommand/GeneratePhpdocWithMixin/__snapshots__/Test__test__1.php @@ -5,6 +5,7 @@ declare(strict_types=1); namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GeneratePhpdocWithMixin\Models; use Illuminate\Database\Eloquent\Model; +use Illuminate\Database\Eloquent\Builder; /** * @property $someProp