Skip to content

Commit 2fc2396

Browse files
authored
Fix #1173 Use FQN for write-mixin (#1174)
* Fix #1173 Use FQN for write-mixin * Fix #1173 Use FQN for write-mixin: Update Test cases
1 parent 37f0832 commit 2fc2396

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

src/Console/ModelsCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1225,7 +1225,7 @@ protected function getClassNameInDestinationFile(object $model, string $classNam
12251225
;
12261226

12271227
$className = trim($className, '\\');
1228-
$writingToExternalFile = !$this->write;
1228+
$writingToExternalFile = !$this->write || $this->write_mixin;
12291229
$classIsNotInExternalFile = $reflection->getName() !== $className;
12301230
$forceFQCN = $this->laravel['config']->get('ide-helper.force_fqn', false);
12311231

tests/Console/ModelsCommand/GeneratePhpdocWithMixin/Models/Post.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GeneratePhpdocWithMixin\Models;
66

77
use Illuminate\Database\Eloquent\Model;
8+
use Illuminate\Database\Eloquent\Builder;
89

910
/**
1011
* @property $someProp

tests/Console/ModelsCommand/GeneratePhpdocWithMixin/__snapshots__/Test__test__1.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GeneratePhpdocWithMixin\Models;
66

77
use Illuminate\Database\Eloquent\Model;
8+
use Illuminate\Database\Eloquent\Builder;
89

910
/**
1011
* @property $someProp

0 commit comments

Comments
 (0)