I know this is a year old now but i've having the exact same problem, did you manage to resolve this?
Sep 10, 2015
3
Level 1
Target [Illuminate\Database\Migrations\MigrationRepositoryInterface] is not instantiable.
Hi all,
I wanted to create a console command that just checks the status of the migrations and have some custom output. Therefore I inject the Migrator, same as the Laravel MigrateCommand is doing. But I get an error with that dependency injection:
[Illuminate\Container\BindingResolutionException]
Target [Illuminate\Database\Migrations\MigrationRepositoryInterface] is not instantiable.
The command is nothing fancy so far:
<?php namespace My\Console\Commands;
use Illuminate\Database\Console\Migrations\BaseCommand;
use Illuminate\Database\Migrations\Migrator;
use Symfony\Component\Console\Input\InputOption;
class MigrateCheckCommand extends BaseCommand {
protected $name = 'migrate:check';
/**
* Create a new command instance.
*
* @return void
*/
public function __construct(Migrator $migrator) {
parent::__construct();
$this->migrator = $migrator;
}
...
}
The exception is thrown before the constructor and when I remove the dependency injection, it's all fine. But want to use $this->migrator->repositoryExists() in my checks.
Any ideas?
Cheers, Rob
Please or to participate in this conversation.