Class Not Found on Chargebee Library in Laravel

huangapple go评论64阅读模式
英文:

Class Not Found on Chargebee Library in Laravel

问题

I installed Chargebee library to my Laravel web (v5.7).
But when I want to use the library, all the class from the library is not found.
Here is my code on the controller

<?php

namespace App\Api\V2\Controllers;

use Chargebee\ChargeBee\Environment as ChargeBee_Environment;
use Chargebee\ChargeBee\Models\Plan as ChargeBee_Plan;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\DB;

class ChargebeeController extends Controller
{
  public function retrieveItem($plan) {
    ChargeBee_Environment::configure(env('CHARGEBEE_ENVIRONMENT'), env('CHARGEBEE_KEY'));
    return $plan_response = ChargeBee_Plan::retrieve($plan);
  }
}

The Chargebee\ChargeBee\Environment and Chargebee\ChargeBee\Models\Plan is not found.

英文:

I installed Chargebee library to my Laravel web (v5.7).
But when I want to use the library, all the class from the library is not found.
Here is my code on the controller

&lt;?php

namespace App\Api\V2\Controllers;

use Chargebee\ChargeBee\Environment as ChargeBee_Environment;
use Chargebee\ChargeBee\Models\Plan as ChargeBee_Plan;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\DB;

class ChargebeeController extends Controller
{
  public function retrieveItem($plan) {
    ChargeBee_Environment::configure(env(&#39;CHARGEBEE_ENVIRONMENT&#39;), env(&#39;CHARGEBEE_KEY&#39;));
    return $plan_response = ChargeBee_Plan::retrieve($plan);
  }
}

The Chargebee\ChargeBee\Environment and Chargebee\ChargeBee\Models\Plan is not found.

答案1

得分: 0

我终于找到了答案。显然应该是ChargeBee\ChargeBee。'B'应该大写。

英文:

I finally found my answer. Apparently it's supposed to be ChargeBee\ChargeBee. The 'B' should be capital.

huangapple
  • 本文由 发表于 2023年7月18日 11:28:09
  • 转载请务必保留本文链接:https://go.coder-hub.com/76709357.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定