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

EliyaCohen's avatar

Undefined method error when I type php artisan.

I tried to update Laravel 5.1 to 5.2 manually and I'm having a problem when I try to run php artisan. I get this message every time:

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

I searched for a solution and I found only a solution that says I should delete the vendor/compiled.php file, but there's no such file in my project. neither in storage.

0 likes
6 replies
hengcs's avatar

I am having the same issue when trying to update Laravel from 5.1 to 5.2. Any clues anyone?

bestmomo's avatar

Do you have laravelcollective ? If you have you must update it in composer :

"laravelcollective/html": "5.2.*-dev
hengcs's avatar

I don't have laravelcollective installed. Here is my composer.json file

{
    "name": "laravel/laravel",
    "description": "The Laravel Framework.",
    "keywords": ["framework", "laravel"],
    "license": "MIT",
    "type": "project",
    "require": {
        "php": ">=5.5.9",
        "laravel/framework": "5.2.*",
        "barryvdh/laravel-ide-helper": "^2.1",
        "fzaninotto/faker": "^1.5",
        "cviebrock/eloquent-sluggable": "^3.1",
        "barryvdh/laravel-debugbar": "^2.0",
        "illuminate/html": "^5.0",
        "prettus/l5-repository": "^2.1",
        "laravel/socialite": "^2.0"
    },
    "require-dev": {
        "mockery/mockery": "0.9.*",
        "phpunit/phpunit": "~4.0",
        "phpspec/phpspec": "~2.1",
        "doctrine/dbal": "~2.3",
        "symfony/dom-crawler": "~3.0",
        "symfony/css-selector": "~3.0"
    },
    "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 clear-compiled",
            "php artisan ide-helper:generate",
            "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"
    }
}
rmff's avatar

@bestmomo you make my day!...

I was totally stuck after do all steps to upgrade Laravel to 5.2... Would be awesome if Laravel community provide some tool to check possible conflicts or show like, "hey you need foo on that file", "Remove bar from this file", etc.

Please or to participate in this conversation.