Call to undefined method Illuminate\Foundation\Application::bindShared()
Error code
Call to undefined method Illuminate\Foundation\Application::bindShared()
Reason
The Form and HTML helpers has been deprecated in Laravel 5.0; The form module relies on the Laravel 5.0 framework, so it is still problematic to call in the default 5.2 framework, and now 5.2 has not been repaired, so it needs to be reinstalled.
Solve
1. Add a line "laravelcollective/html" to the require of the Composer.json file: "~5.0″ complete version
"require": { "php": ">=5.5.9", "laravel/framework": "5.2.*", "illuminate/html": "^5.0", "barryvdh/laravel-ide-helper": "v2.1.2", "laravelcollective/html": "~5.0" },
Composer.json location in Laravel directory root layer
2. Then run the command
composer update
Mainly through composer to re-manage the files of the Laravel framework
3. After the update is successful, modify the config/app.php file to add configuration:
#增加providers数组项 ‘providers‘ => [ // ... Collective\Html\HtmlServiceProvider::class, // ... ], #增加alias数组项 ‘aliases‘ => [ // ... ‘Form‘ => Collective\Html\FormFacade::class, ‘Html‘ => Collective\Html\HtmlFacade::class, // ... ],
Learn some of the mistakes Laravel encountered