Skip to content

Commit 610262c

Browse files
author
Marcel Pociot
committed
Create open PHP tag when ModelFactory.php doesnt exist (issue #3)
1 parent 380a2df commit 610262c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Console/GenerateCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ protected function generateFactories($loadModels, $ignore = '')
144144
}
145145
}
146146

147-
$output = $this->reset ? '<?php'."\n\n" : $this->existingFactories;
147+
$output = ($this->reset || !$this->files->exists('database/factories/ModelFactory.php')) ? '<?php'."\n\n" : $this->existingFactories;
148148
$ignore = explode(',', $ignore);
149149

150150
foreach ($models as $name) {

0 commit comments

Comments
 (0)