다른 서비스 공급자의 IoC에서 지연된 서비스를 검색하려고하면 오류가 발생합니다. HashingServiceProvider
에 true
에 $deffered = false
변경Laravel 지연된 서비스 종속성
class ServiceProvider extends \Illuminate\Support\ServiceProvider {
// ...
public function register() {
$router = \App::make('router'); // gets resolved
$hash = \App::make('hash'); // throws an error (Class hash does not exists)
}
// ...
}
이 문제를 해결합니다. 내가 뭘 잘못하고 있니?
"내가 뭘 잘못하고 있니?" 정적 팩토리를 사용하여 종속성 주입을 시도합니다. – Danack
정적이 아닙니다. laravel의 IoC에 익숙합니까? –
'Yes :: it_is ($ static)' – Dan