首页 > 解决方案 > 在生产中找不到类“Srmklive\PayPal\Facades\Paypal”

问题描述

我正在使用一个名为“srmklive/paypal”的 laravel paypal 插件。该插件在我的本地工作,但不在生产服务器中工作。当我检查日志时,它提示我这个错误。这是服务器的详细信息,

php 版本:7.2 Laravel 版本:5.8.8

请帮助解决这个问题。

日志向我显示此错误:

production.ERROR: Class 'Srmklive\PayPal\Facades\Paypal' not found
{"exception":"[object](Symfony\\Component\\Debug\\Exception\\FatalThrowableError(code: 0):
Class 'Srmklive\\PayPal\\Facades\\Paypal' not found at /home/forge/pixerbear-api.tk/app/Http/Controllers/PaymentController.php:26)

同时我的 PaymentController :

use Auth;
use DB;
use App\Credit;
use App\Storage;
use App\Payment;
use App\ProviderStorage;
use App\UserCredit;
use Response;
use Carbon\Carbon;
use Illuminate\Support\Str;
use Srmklive\PayPal\Facades\Paypal;
use Srmklive\PayPal\Services\ExpressCheckout;
use Illuminate\Http\Request;

class PaymentController extends Controller
{
    private $provider;

    public function __construct()
    {
        $this->provider = new ExpressCheckout;
        $this->provider = PayPal::setProvider('express_checkout');
    }
}

标签: laravelpaypaldependencieslaravel-forge

解决方案


您可以在此处的命名空间中有错字;use Srmklive\PayPal\Facades\Paypal;. 它应该是use Srmklive\PayPal\Facades\PayPal;(注意大写P)。


推荐阅读