3
AttachUsers라는 명령을 만들었습니다. 내가 명령을 실행할 때 나는 Laravel 4 숙련공이 바인딩을 인식하지 못함
Argument 1 passed to AttachPhones::__construct() must be an instance of Acme\\Repositories\\Organizations\\OrganizationRepositoryInterface, none given, called in \/Users\/jonson\/sites\/acme\/app\/start\/artisan.php on line 5 and defined","file":"\/Users\/jonson\/sites\/acme\/app\/commands\/AttachPhones.php","line":30}}
내가 저장소 서비스 공급자 파일 내 인터페이스를 결합하고 그것이 현재 나의 컨트롤러에서 워킹됩니다
를 얻을. 내 명령 파일은 다음과 같습니다.<?php
use Illuminate\Console\Command;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputArgument;
use \Acme\Repositories\Organizations\OrganizationRepositoryInterface;
class AttachUsers extends Command {
protected $organizations;
/**
* The console command name.
*
* @var string
*/
protected $name = 'acme:attach_users';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Cron command to attach users from import to organizations';
/**
* Create a new command instance.
*
* @return void
*/
public function __construct(OrganizationRepositoryInterface $organizations)
{
$this->organizations = $organizations;
parent::__construct();
}
나는 그것을 시도했지만 아무런 효과가 없었다. – user3061986