|
14 | 14 | use Illuminate\Database\Eloquent\Model as EloquentModel; |
15 | 15 | use Illuminate\Support\Collection; |
16 | 16 | use Symfony\Component\Console\Output\OutputInterface; |
| 17 | +use Illuminate\Foundation\Application; |
17 | 18 |
|
18 | 19 | /** |
19 | 20 | * |
@@ -437,7 +438,7 @@ public function callArtisan($command, $parameters = [], OutputInterface $output |
437 | 438 | $this->debug($output); |
438 | 439 | return $output; |
439 | 440 | } |
440 | | - |
| 441 | + |
441 | 442 | $console->call($command, $parameters, $output); |
442 | 443 | } |
443 | 444 |
|
@@ -1164,7 +1165,7 @@ public function haveMultiple($model, $times, $attributes = [], $name = 'default' |
1164 | 1165 | $this->fail("Could not create model: \n\n" . get_class($e) . "\n\n" . $e->getMessage()); |
1165 | 1166 | } |
1166 | 1167 | } |
1167 | | - |
| 1168 | + |
1168 | 1169 | /** |
1169 | 1170 | * Use Laravel's model factory to make a model instance. |
1170 | 1171 | * Can only be used with Laravel 5.1 and later. |
@@ -1192,7 +1193,7 @@ public function make($model, $attributes = [], $name = 'default') |
1192 | 1193 | $this->fail("Could not make model: \n\n" . get_class($e) . "\n\n" . $e->getMessage()); |
1193 | 1194 | } |
1194 | 1195 | } |
1195 | | - |
| 1196 | + |
1196 | 1197 | /** |
1197 | 1198 | * Use Laravel's model factory to make multiple model instances. |
1198 | 1199 | * Can only be used with Laravel 5.1 and later. |
@@ -1236,7 +1237,13 @@ protected function modelFactory($model, $name, $times = 1) |
1236 | 1237 | 'This functionality relies on Laravel model factories, which were introduced in Laravel 5.1.'); |
1237 | 1238 | } |
1238 | 1239 |
|
1239 | | - return factory($model, $name, $times); |
| 1240 | + if (version_compare(Application::VERSION, '7.0.0', '<')) { |
| 1241 | + $factory = factory($model, $name, $times); |
| 1242 | + } else { |
| 1243 | + $factory = factory($model, $times); |
| 1244 | + } |
| 1245 | + |
| 1246 | + return $factory; |
1240 | 1247 | } |
1241 | 1248 |
|
1242 | 1249 | /** |
|
0 commit comments