Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions src/Codeception/Module/Laravel5.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
use Illuminate\Database\Eloquent\Model as EloquentModel;
use Illuminate\Support\Collection;
use Symfony\Component\Console\Output\OutputInterface;
use Illuminate\Foundation\Application;

/**
*
Expand Down Expand Up @@ -437,7 +438,7 @@ public function callArtisan($command, $parameters = [], OutputInterface $output
$this->debug($output);
return $output;
}

$console->call($command, $parameters, $output);
}

Expand Down Expand Up @@ -1164,7 +1165,7 @@ public function haveMultiple($model, $times, $attributes = [], $name = 'default'
$this->fail("Could not create model: \n\n" . get_class($e) . "\n\n" . $e->getMessage());
}
}

/**
* Use Laravel's model factory to make a model instance.
* Can only be used with Laravel 5.1 and later.
Expand Down Expand Up @@ -1192,7 +1193,7 @@ public function make($model, $attributes = [], $name = 'default')
$this->fail("Could not make model: \n\n" . get_class($e) . "\n\n" . $e->getMessage());
}
}

/**
* Use Laravel's model factory to make multiple model instances.
* Can only be used with Laravel 5.1 and later.
Expand Down Expand Up @@ -1236,7 +1237,13 @@ protected function modelFactory($model, $name, $times = 1)
'This functionality relies on Laravel model factories, which were introduced in Laravel 5.1.');
}

return factory($model, $name, $times);
if (version_compare(Application::VERSION, '7.0.0', '<')) {
$factory = factory($model, $name, $times);
} else {
$factory = factory($model, $times);
}

return $factory;
}

/**
Expand Down