通过 composer 安装 tcpdf 和 maatwebsite/excel 时找不到 pusher class

pusher class not found when install tcpdf and maatwebsite/excel via composer

当通过 composer 安装 pusher 时它有效!

composer require pusher/pusher-php-server

但是当通过 composer >> pdf 和 excel 安装 elibyy/tcpdf-laravelmaatwebsite/excel 时有效但推杆无效 !!

错误 >> Class 未找到 Pusher !!

composer.json

"require": {
    "php": ">=5.6.4",
    "laravel/framework": "5.3.*",
    "caouecs/laravel-lang": "~3.0",
    "laravelcollective/html": "^5.3.0",
    "yajra/laravel-datatables-oracle": "6.25.0",
    "laravel/socialite": "2.0.21",
    "musonza/chat": "^1.0",
    "guzzlehttp/guzzle": "^6.2",
    "pusher/pusher-php-server": "^3.0",
    "illuminate/support": "5.3.*",
    "tecnickcom/tcpdf": "6.2.12",
    "elibyy/tcpdf-laravel": "5.3.0",
    "maatwebsite/excel": "2.1.*"
},

通过任何更改,您是否将 Pusher 从 2.x 版本升级到 3.0.0?他们引入了命名空间,所以试试:

new \Pusher\Pusher($auth_key, $secret, $app_id);

或导入:

<?php

use Pusher\Pusher;
// ...

$pusher = new Pusher($auth_key, $secret, $app_id);