update(config/model command): add option to force usage of FQN + tests (#1031)

This commit is contained in:
edvordo
2020-09-01 09:11:12 +02:00
committed by GitHub
parent 4a6d127440
commit a96add6981
5 changed files with 267 additions and 1 deletions
+2 -1
View File
@@ -1067,8 +1067,9 @@ class ModelsCommand extends Command
$className = trim($className, '\\');
$writingToExternalFile = !$this->write;
$classIsNotInExternalFile = $reflection->getName() !== $className;
$forceFQCN = $this->laravel['config']->get('ide-helper.force_fqn', false);
if ($writingToExternalFile && $classIsNotInExternalFile) {
if (($writingToExternalFile && $classIsNotInExternalFile) || $forceFQCN) {
return '\\' . $className;
}