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

sergiuwd's avatar

bindShared() error when calling php artisan

I have Laravel 5.3 and I have installed the laravel/socialite package v2.0. Now, whenever I call php artisan, I get this error:

[Symfony\Component\Debug\Exception\FatalErrorException] Call to undefined method Illuminate\Foundation\Application::bindShared()

What could be wrong with it? I've googled it and found something about the Illuminate\HTML package, but I don't use it.

Here is my composer.json file:

{
    "name": "laravel/laravel",
    "description": "The Laravel Framework.",
    "keywords": ["framework", "laravel"],
    "license": "MIT",
    "type": "project",
    "require": {
        "php": ">=5.6.4",
        "laravel/framework": "5.3.*",
        "zizaco/entrust": "5.2.x-dev",
        "laravelcollective/html": "^5.3.0",
        "webpatser/laravel-countries": "dev-master",
        "doctrine/dbal": "^2.5",
        "lavary/laravel-menu": "^1.6",
        "laravel/socialite": "2.0"
    },
    "require-dev": {
        "fzaninotto/faker": "~1.4",
        "mockery/mockery": "0.9.*",
        "phpunit/phpunit": "~5.0",
        "symfony/css-selector": "3.1.*",
        "symfony/dom-crawler": "3.1.*",
        "laravel/homestead": "^4.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"
    }
}
0 likes
7 replies
davidpiesse's avatar

bindShared has been renamed to $app->singleton()

I would update composer to make sure that is not the issue. From the looks of it Entrust could be updated as a start - but check other packages and their issue lists for this occurring (I already fixed this in the Identicons package).

sergiuwd's avatar

I read that 3.0 is for Laravel 5.4...

sergiuwd's avatar

It does not even install it:

Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Installation request for laravel/socialite 3.0 -> satisfiable by laravel/socialite[v3.0.0].
    - Conclusion: remove laravel/framework v5.3.30
    - Conclusion: don't install laravel/framework v5.3.30
    - laravel/socialite v3.0.0 requires illuminate/http ~5.4 -> satisfiable by illuminate/http[v5.4.0, v5.4.9].
    - don't install illuminate/http v5.4.0|don't install laravel/framework v5.3.30
    - don't install illuminate/http v5.4.9|don't install laravel/framework v5.3.30
    - Installation request for laravel/framework (locked at v5.3.30, required as 5.3.*) -> satisfiable by laravel/framework[v5.3.30].
davidpiesse's avatar

I retract my understanding then :D

Remove a package at a time to see which one is at fault. My resolved Identicon issue was upgrading from a 5.2 to 5.4...

I had a check of their issues list and nothing stood out at me as a similar issue on their front pages.

cipsas's avatar

@sergiuwd Correct me if I'm wrong, but if you in composer set:

"laravel/socialite": "2.0"

it will install version 2.0.0 . and at 2.0 there was many minor updates, latest 2.0.20

I recommend change it to

"laravel/socialite": "^2.0"

and update composer. Maybe there was bug in 2.0.0 release

Please or to participate in this conversation.