search

Home  >  Q&A  >  body text

Classes for Chargebee library not found in Laravel.

I installed the Chargebee library onto my Laravel website (version 5.7). But when I want to use the library, all the classes from the library are not found. Here is my controller code:

<?php

namespace AppApiV2Controllers;

use ChargebeeChargeBeeEnvironment as ChargeBee_Environment;
use ChargebeeChargeBeeModelsPlan as ChargeBee_Plan;
use AppHttpControllersController;
use IlluminateSupportFacadesDB;

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

ChargebeeChargeBeeEnvironment and ChargebeeChargeBeeModelsPlan classes cannot be found.

P粉041758700P粉041758700493 days ago701

reply all(1)I'll reply

  • P粉574268989

    P粉5742689892023-07-21 00:26:33

    Obviously it should be ChargeBee\ChargeBee, and the 'B' should be capitalized.

    reply
    0
  • Cancelreply