pusher / pusher-http-laravel

[DEPRECATED] A Pusher Channels bridge for Laravel
MIT License
402 stars 61 forks source link

Class 'Pusher\Pusher' not found #26

Closed ghost closed 7 years ago

ghost commented 7 years ago

Since the last update i get this error

Symfony\Component\Debug\Exception\FatalThrowableError: Class 'Pusher\Pusher' not found in D:\Xampp7\htdocs\cookme\vendor\vinkla\pusher\src\PusherFactory.php:79

ghost commented 7 years ago

as i can see it installs pusher/pusher-php-server (2.6.4) and not 3.0.0 ..... adding in composer "pusher/pusher-php-server": "^3.0" leads to

vinkla commented 7 years ago

What version of this package and Laravel are you using?

ghost commented 7 years ago

sorry i forgot it Laravel 5.4 and pusher 2.5.0

vinkla commented 7 years ago

Please paste your composer.json file.

ghost commented 7 years ago
{
    "name": "laravel/laravel",
    "description": "The Laravel Framework.",
    "keywords": ["framework", "laravel"],
    "license": "MIT",
    "type": "project",
    "require": {
        "php": ">=5.6.4",
        "alaouy/youtube": "^2.1",
        "arcanedev/log-viewer": "^4.3",
        "barryvdh/laravel-cors": "^0.8.0",
        "barryvdh/laravel-dompdf": "^0.8.0",
        "fitztrev/query-tracer": "^1.0",
        "garygreen/pretty-routes": "^0.0.6",
        "intervention/image": "^2.3",
        "ktquez/laravel-tinymce": "^1.0",
        "laravel/framework": "5.4.*",
        "laravel/socialite": "^2.0",
        "laravel/tinker": "~1.0",
        "laravelcollective/html": "^5.3.0",
        "mews/purifier": "^2.0",
        "regulus/activity-log": "0.6.*",
        "spatie/browsershot": "^1.5",
        "stichoza/google-translate-php": "3.2.*",
        "vinkla/pusher": "^2.5",
        "wnx/screeenly-client": "~2.0",
        "yangqi/htmldom": "dev-master"
    },
    "require-dev": {
        "fzaninotto/faker": "~1.4",
        "mockery/mockery": "0.9.*",
        "phpunit/phpunit": "~5.7",
        "symfony/dom-crawler": "2.8.*|3.0.*",
        "barryvdh/laravel-debugbar": "^2.3"
    },
    "autoload": {
        "classmap": [
            "database"
        ],
        "files":[
            "app/Includes/Helpers.php",
            "app/Includes/Regex.php",
            "app/Includes/AdminHelpers.php"
        ],
        "psr-4": {
            "App\\": "app/"
        }
    },
    "autoload-dev": {
        "psr-4": {
            "Tests\\": "tests/"
        }
    },
    "scripts": {
        "post-root-package-install": [
            "php -r \"file_exists('.env') || copy('.env.example', '.env');\""
        ],
        "post-create-project-cmd": [
            "php artisan key:generate"
        ],
        "post-install-cmd": [
            "Illuminate\\Foundation\\ComposerScripts::postInstall",
            "php artisan optimize"
        ],
        "post-update-cmd": [
            "Illuminate\\Foundation\\ComposerScripts::postUpdate",
            "php artisan optimize"
        ]
    },
    "config": {
        "preferred-install": "dist",
        "sort-packages": true
    }
}
vinkla commented 7 years ago

It looks okay, try removing the vendor directory and run composer install again.

ghost commented 7 years ago

sorry but what do you mean vendor map ?

vinkla commented 7 years ago

The vendor directory in the root of your project.

ghost commented 7 years ago

i deleted the composer cache too but it didn't help

it downloads pusher 2.5 and pusher-php-server 2.6.4(and graham-campbell/manager 2.5)

vinkla commented 7 years ago

Then it should work. I haven't had any problems myself. The tests pass so this is probably something in your environment and not a bug in this package.

ghost commented 7 years ago

That was my initial thought .... Thanks for the help

ghost commented 7 years ago

Sorry to reopen this but composer doesn't download the right version of the package ... Here's the composer.json for the package i got after deleting the vendor folder,the composer cache and composer.lock { "name": "vinkla/pusher", "description": "A Pusher bridge for Laravel", "license": "MIT", "keywords": ["laravel", "pusher", "http", "api", "php-pusher-server", "rest", "realtime", "trigger", "publish", "events"], "authors": [ { "name": "Vincent Klaiber", "email": "hello@vinkla.com", "homepage": "https://vinkla.com" } ], "require": { "php": "^7.0", "illuminate/contracts": "5.3. || 5.4.", "illuminate/support": "5.3. || 5.4.", "graham-campbell/manager": "^2.5", "pusher/pusher-php-server": "^2.6" }, "require-dev": { "graham-campbell/testbench": "^3.3", "mockery/mockery": "^0.9.5", "phpunit/phpunit": "^5.7" }, "autoload": { "psr-4": { "Vinkla\Pusher\": "src/" } }, "autoload-dev": { "psr-4": { "Vinkla\Tests\Pusher\": "tests/" } }, "config": { "preferred-install": "dist" }, "extra": { "branch-alias": { "dev-master": "2.5-dev" } }, "minimum-stability": "dev", "prefer-stable": true }

AhmedHdeawy commented 6 years ago

in your config/app.php add this line to aliases

'Pusher' => Pusher\Pusher::class,

kn100 commented 6 years ago

Hi,

You should also look into updating to the latest version. It was recently brought in house, kindly donated from @vinkla :)

fluvios commented 6 years ago

hello i want to ask, whats the problem with my code ? i used laravel 5.3.2 and pusher/pusher-http-laravel 2.3.0

in array providers Pusher\Laravel\PusherServiceProvider::class,

in array aliases 'Pusher' => Pusher\Laravel\Facades\Pusher::class,

[Symfony\Component\Debug\Exception\FatalThrowableError] Class 'Pusher\Laravel\PusherServiceProvider' not found

AkshatSrivastava2 commented 6 years ago

@fluvios Add this only.

in your config/app.php add this line to aliases

'Pusher' => Pusher\Pusher::class,

Worked for me thanks. @AhmedHdeawy

rubengp99 commented 5 years ago

in your config/app.php add this line to aliases

'Pusher' => Pusher\Pusher::class,

This worked for me too. You saved my day.

AliHassan13 commented 4 years ago

try this command and install it. composer require pusher/pusher-php-server

Aiotouch commented 2 years ago

Hello everyone, please I'm having issue with pusher. I'm using laravel 8 with pusher. Here's the error:

Error

Class "Pusher\Pusher" not found

at vendor/laravel/framework/src/Illuminate/Broadcasting/BroadcastManager.php:216 212▕ @return \Illuminate\Contracts\Broadcasting\Broadcaster 213▕ / 214▕ protected function createPusherDriver(array $config) 215▕ { ➜ 216▕ $pusher = new Pusher( 217▕ $config['key'], $config['secret'], 218▕ $config['app_id'], $config['options'] ?? [] 219▕ ); 220▕

  +5 vendor frames 

6 routes/channels.php:19 Illuminate\Support\Facades\Facade::__callStatic()

7 app/Providers/BroadcastServiceProvider.php:19 require("/opt/lampp/htdocs/jobbersconnect/routes/channels.php") Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 1

Aiotouch commented 2 years ago

From my little research it seems Pusher can't run on PHP 8.0 and I'm running PHP 8.0 on my system. If this is the issue, please can you help me with a way out?

mirza4027 commented 2 years ago

@Aiotouch any updates, I am facing this issue with Laravel 8.0, everything is working normally on local, but get thus error message on staging server