[英]Softon\Indipay is not instantiable while building
I received this message when i try to instantiate Soften\\Indipay
on Laravel 5.4* github 当我尝试在Laravel 5.4 * github上实例化
Soften\\Indipay
时收到此消息
Target [Softon\\Indipay\\Gateways\\PaymentGatewayInterface] is not instantiable while building [\\Softon\\Indipay\\Indipay].
构建[\\ Softon \\ Indipay \\ Indipay]时,目标[Softon \\ Indipay \\ Gateways \\ PaymentGatewayInterface]无法实例化。
i registered it in the app/config.php
but it doesn't work, how can i fix it ? 我在
app/config.php
注册但它不起作用,我该如何解决?
'providers' => [
....
Softon\Indipay\IndipayServiceProvider::class,
....
];
Thank you. 谢谢。
In your Laravel vendor\\softon\\indipay\\src\\IndipayServiceProvider.php
modify the register
function so that there are no leading slashes in the bindings. 在Laravel
vendor\\softon\\indipay\\src\\IndipayServiceProvider.php
修改register
功能,以便绑定中没有前导斜杠。
$this->app->bind('indipay', '\Softon\Indipay\Indipay');
$this->app->bind('\Softon\Indipay\Gateways\PaymentGatewayInterface','\Softon\Indipay\Gateways\\'.$gateway.'Gateway');
should now look like 现在应该是这样的
$this->app->bind('indipay', 'Softon\Indipay\Indipay');
$this->app->bind('Softon\Indipay\Gateways\PaymentGatewayInterface','Softon\Indipay\Gateways\\'.$gateway.'Gateway');
Also, don't forget to add the Indipay alias as 另外,不要忘记将Indipay别名添加为
'Indipay' => 'Softon\Indipay\Facades\Indipay',
in your config/app.php
在你的
config/app.php
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.