【发布时间】:2015-10-22 02:24:31
【问题描述】:
我正在尝试将我的应用从 Laravel 4.2 迁移到 Laravel 5.1。我在这里有一个条带实现。
我的文件夹 app\Acme\Billing 中有一个 BillingInterface.php 和 StripeBilling.php。
我在app\Providers 中有BillingServiceProvicer.php
在我的PaymentController 中,我正在尝试以下代码,但出现错误:
use Acme\Billing;
$card = App::make('App\Acme\Billing\BillingInterface');
try {
$new_card = $card->addcard([
'customer_id' => $cards->customer_id,
'token' => Input::get('stripe_token')
]);
错误:
Container.php 第 736 行中的反射异常:类 App\Acme\Billing\BillingInterface 不存在
我该如何解决这个问题?
【问题讨论】:
-
如何将接口映射到具体实现?
标签: php laravel-4 stripe-payments laravel-5.1