Vidya Sagar Panati
Vidya Sagar Panati

Reputation: 49

Class not found Error when running the application

I'm working on an application with Laravel framework. When I tried loading the application(http://localhost/laravel/public/) from firefox browser, I get the below error:

FatalErrorException in C:\wamp\www\laravel\vendor\laravel\framework\src\Illuminate\Foundation\ProviderRepository.php line 150: Class 'Illuminate\Broadcasting\BroadcastServiceProvider' not found

I tried solving this by following few of the solutions mentioned below, but I couldn't get out.

  1. I tried uninstalling the Composer and installing it with --dev-o and this didn't work for me.
  2. I tried moving the folder Vendor out of my application(laravel) and then bringing it in by changing the composer.lock file. And this didn't work.
  3. I tried renaming my namespace: C:\wamp\www\laravel>php artisan app:name laravel Even this gives me the same error: [Symfony\Component\Debug\Exception\FatalErrorException] Class 'Illuminate\Broadcasting\BroadcastServiceProvider' not found

My composer.json file components:

{
    "name": "laravel/laravel",
    "description": "The Laravel Framework.",
    "keywords": ["framework", "laravel"],
    "license": "MIT",
    "type": "project",
    "require": { "php": ">=5.5.9", "laravel/framework": "5.1.*"
    },
    "require-dev": {
        "fzaninotto/faker": "~1.4", "mockery/mockery": "0.9.*", 
        "phpunit/phpunit": "~4.0", "phpspec/phpspec": "~2.1"
    },
    "autoload": {
        "classmap": ["database"],
        "psr-4": {"App\\": "app/"}
    },
    "autoload-dev": {"classmap": ["tests/TestCase.php"]},
    "scripts": {
        "post-install-cmd": ["php artisan clear-compiled","php artisan optimize"],
        "pre-update-cmd": ["php artisan clear-compiled"],
        "post-update-cmd": ["php artisan optimize"],
        "post-root-package-install": ["php -r \"copy('.env.example', '.env');\"" ],
        "post-create-project-cmd": ["php artisan key:generate"]
    },
    "config": {"preferred-install": "dist"},
    "require": {"illuminate/html": "5.*","laravel/framework": "5.0.*"}
}

Your help will get me out of this limbo.

Upvotes: 2

Views: 3174

Answers (1)

Dawlatzai Ghousi
Dawlatzai Ghousi

Reputation: 3978

You should run

composer install --no-dev --no-scripts

and then

composer install --no-dev -o

Upvotes: 1

Related Questions