0
这是我的注册方法。我有两个绑定。第二个CaptionOrderSubmission是我感兴趣的一个。在注册方法中直接注入所需的依赖关系
public function register()
{
$clientKey = env('REV_CLIENT_API_KEY');
$userKey = env('REV_USER_API_KEY');
$endPoint = env('REV_URL_END_POINT');
App::bind('RevAPI\Rev', function($app) use($clientKey, $userKey, $endPoint)
{
return new Rev($clientKey, $userKey, $endPoint);
});
App::bind('RevAPI\CaptionOrderSubmission', function($app) use($clientKey, $userKey, $endPoint)
{
$rev = new Rev($clientKey, $userKey, $endPoint);
return new CaptionOrderSubmission($rev);
});
}
我该怎么办?
public function register()
{
$clientKey = env('REV_CLIENT_API_KEY');
$userKey = env('REV_USER_API_KEY');
$endPoint = env('REV_URL_END_POINT');
App::bind('RevAPI\Rev', function($app) use($clientKey, $userKey, $endPoint)
{
return new Rev($clientKey, $userKey, $endPoint);
});
App::bind('RevAPI\CaptionOrderSubmission', function($app) use(RevApi/Rev $rev)
{
return new CaptionOrderSubmission($rev);
});
}
这可能吗?