Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

tetradude77's avatar

Laravel 5.3 / Spark 2.0.10 and install error

Hi Guys,

I just setup a new Ubuntu 16.04.1 LTS server on Digital Ocean with PHP7.0.8.

I pulled my Laravel/Spark project from Bitbucket. Then I executed "Composer Update" but received error. Then I typed "php artisan" and here's the error message:

[ErrorException] Declaration of App\Providers\EventServiceProvider::boot(Illuminate\Contracts\Events\Dispatcher $events) should be compatible with Illuminate\Foundation\Support\Providers\EventServiceProvider::boot()

What might be the problem? I couldn't find any similar issues on Google.

Thank you guys!

0 likes
6 replies
tetradude77's avatar

Here's the flow:

  1. git pull
  2. composer update (and returns error I have mentioned above at the end)

Here's the composer.json:

{
    "name": "laravel/laravel",
    "description": "The Laravel Framework.",
    "keywords": ["framework", "laravel"],
    "license": "MIT",
    "type": "project",
    "repositories": [
        {
            "type": "composer",
            "url": "https://spark-satis.laravel.com"
        }
    ],
    "require": {
        "php": ">=5.5.9",
        "laravel/framework": "5.3.*",
        "laravel/spark": "2.*",
        "laravel/cashier": "7.*",
        "hashids/hashids": "^1.0",
        "guzzlehttp/guzzle": "^6.2",
        "bugsnag/bugsnag-laravel": "^1.6"
    },
    "require-dev": {
        "fzaninotto/faker": "~1.4",
        "mockery/mockery": "0.9.*",
        "phpunit/phpunit": "~4.0",
        "symfony/css-selector": "2.8.*|3.0.*",
        "symfony/dom-crawler": "2.8.*|3.0.*"
    },
    "autoload": {
        "classmap": [
            "database"
        ],
        "psr-4": {
            "App\\": "app/"
        }
    },
    "autoload-dev": {
        "classmap": [
            "tests/TestCase.php"
        ]
    },
    "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"
    }
}
ejdelmonico's avatar

Well, that is interesting. I haven't pushed my project as of yet (Forge server), but I can tell you that my larval 5.3 and spark 2.0.10 project composer.json files look very different than the one you just posted.

ejdelmonico's avatar

This is what my root level composer.json looks like.

{
    "name": "laravel/laravel",
    "description": "The Laravel Framework.",
    "keywords": [
        "framework",
        "laravel"
    ],
    "license": "MIT",
    "type": "project",
    "require": {
        "php": ">=5.6.4",
        "laravel/framework": "5.3.*",
        "laravel/cashier": "~7.0",
        "laravel/spark": "*@dev"
    },
    "require-dev": {
        "fzaninotto/faker": "~1.4",
        "mockery/mockery": "0.9.*",
        "phpunit/phpunit": "~5.0",
        "symfony/css-selector": "3.1.*",
        "symfony/dom-crawler": "3.1.*"
    },
    "autoload": {
        "classmap": [
            "database"
        ],
        "psr-4": {
            "App\\": "app/"
        }
    },
    "autoload-dev": {
        "classmap": [
            "tests/TestCase.php"
        ]
    },
    "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"
    },
    "repositories": [
        {
            "type": "path",
            "url": "./spark"
        }
    ]
}
tetradude77's avatar

Thanks for your answer. I found the problem. It was related to Laravel 5.2 to 5.3 upgrade (https://laravel.com/docs/5.3/upgrade#upgrade-5.3.0):

You may remove the arguments from the boot method on the EventServiceProvider, RouteServiceProvider, and AuthServiceProvider classes. Any calls to the given arguments may be converted to use the equivalent facade instead. So, for example, instead of calling methods on the $dispatcher argument, you may simply call the Event facade. Likewise, instead of making method calls to the $router argument, you may make calls to the Route facade, and instead of making method calls to the $gate argument, you may make calls to the Gate facade.

Please or to participate in this conversation.