【问题标题】:Stripe Billing in Laravel 5.1 Class not found未找到 Laravel 5.1 类中的条带计费
【发布时间】:2015-10-22 02:24:31
【问题描述】:

我正在尝试将我的应用从 Laravel 4.2 迁移到 Laravel 5.1。我在这里有一个条带实现。

我的文件夹 app\Acme\Billing 中有一个 BillingInterface.phpStripeBilling.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


【解决方案1】:

这对我有帮助:

$card = App::make(BillingInterface::class);

【讨论】:

    猜你喜欢
    • 2015-08-06
    • 2016-01-14
    • 2015-10-13
    • 2016-03-13
    • 2015-11-16
    • 2015-08-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多