Php Softon\Indipay在生成时不可实例化

Php Softon\Indipay在生成时不可实例化,php,laravel,payment-gateway,service-provider,Php,Laravel,Payment Gateway,Service Provider,我在尝试在Laravel 5.4上实例化software\Indipay时收到此消息* 目标[Softon\Indipay\Gateways\PaymentGatewayInterface]在生成[\Softon\Indipay\Indipay]时不可实例化 我在app/config.php中注册了它,但它不起作用,我如何修复它 'providers' => [ .... Softon\Indipay\IndipayServiceProvider::class,

我在尝试在Laravel 5.4上实例化
software\Indipay
时收到此消息*

目标[Softon\Indipay\Gateways\PaymentGatewayInterface]在生成[\Softon\Indipay\Indipay]时不可实例化

我在
app/config.php
中注册了它,但它不起作用,我如何修复它

'providers' => [
    ....
    Softon\Indipay\IndipayServiceProvider::class,
    ....
];

谢谢。

在您的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');
现在看起来应该像

$this->app->bind('indipay', 'Softon\Indipay\Indipay');
$this->app->bind('Softon\Indipay\Gateways\PaymentGatewayInterface','Softon\Indipay\Gateways\\'.$gateway.'Gateway');
另外,不要忘记将Indipay别名添加为

'Indipay' => 'Softon\Indipay\Facades\Indipay',

在您的
config/app.php中
在您的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');
现在看起来应该像

$this->app->bind('indipay', 'Softon\Indipay\Indipay');
$this->app->bind('Softon\Indipay\Gateways\PaymentGatewayInterface','Softon\Indipay\Gateways\\'.$gateway.'Gateway');
另外,不要忘记将Indipay别名添加为

'Indipay' => 'Softon\Indipay\Facades\Indipay',
在您的
config/app.php