laravel - 在生产中找不到类“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');
}
}
解决方案
您可以在此处的命名空间中有错字;use Srmklive\PayPal\Facades\Paypal;
. 它应该是use Srmklive\PayPal\Facades\PayPal;
(注意大写P
)。
推荐阅读
- java - Springboot SimpMessagingTemplate convertAndSend 不发送消息
- liferay - Liferay Web Content Structure:用于选择多个图像的字段
- javascript - 使用“复制”字词的数据表搜索不起作用
- c++ - 当我在 QT 框架内的 C++ 中链接 C 文件时未定义的引用
- sql - 在 while 循环中使用存储过程的输出
- .net - 在结构的转换方法中抛出 InvalidCastException 或 ArgumentException
- typescript - 从接口到递归类型的 Typescript 转换引发类型错误中缺少索引签名
- javascript - 我有 2 个数组,我想在 javascript 中创建一个对象数组
- css - 嵌套的 CSS 不使用 Next JS 加载
- json - Jolt:合并属性