简体   繁体   English

Softon \\ Indipay在构建时不可实例化

[英]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.

相关问题 Laravel 支付网关 - Softon\Indipay\Exceptions\IndipayParametersMissingException - Laravel payment gateway - Softon\Indipay\Exceptions\IndipayParametersMissingException Laravel:在构建时无法实例化目标 - Laravel: Target is not instantiable while building 在 Laravel 中构建控制器时接口不可实例化 - Interface is not instantiable while building Controller in Laravel Lumen + Dingo + JWT在构建时不可实例化 - Lumen + Dingo + JWT is not instantiable while building 目标 [App\\Interfaces\\IPostRepository] ​​在构建时不可实例化 - Target [App\Interfaces\IPostRepository] is not instantiable while building PHP-构建[Spatie \\ Cors \\ Cors]时无法实例化 - PHP - not instantiable while building [Spatie\Cors\Cors] Laravel 5.7:目标在构建时不可实例化 - Laravel 5.7: target is not instantiable while building 目标 [League\\OAuth2\\Server\\Repositories\\ClientRepositoryInterface] 在构建 [League\\OAuth2\\Server\\AuthorizationServer] 时不可实例化 - Target [League\OAuth2\Server\Repositories\ClientRepositoryInterface] is not instantiable while building [League\OAuth2\Server\AuthorizationServer] Laravel 5目标不可实例化 - Laravel 5 target is not instantiable 目标 Laravelista 不可实例化 - Target Laravelista is not instantiable
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM