Error code when calling laravel5.2form
Call to undefined method Illuminate\Foundation\Application::bindShared()
Cause
The Form and HTML helpers have been deprecated in Laravel 5.0; The form module depends on The laravel 5.0 framework. Therefore, The call in The default 5.2 framework is still faulty. Currently, 5.2 has not been repaired, therefore, you need to reinstall it.
Solution
1. add a line "laravelcollective/html" in The require of the composer. json file: "~ 5.0 completed
"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 is located at the root layer of the laravel directory.
2. then run the command
Composer update
Mainly through composer to re-manage laravel framework files
The update process is as follows:
composer update> php artisan clear-compiledLoading composer repositories with package informationUpdating dependencies (including require-dev) - Removing symfony/yaml (v3.0.1) - Installing symfony/yaml (v3.0.2) Downloading: 100% - Removing phpspec/prophecy (v1.5.0) - Installing phpspec/prophecy (v1.6.0) Downloading: 100% - Removing phpunit/phpunit (4.8.21) - Installing phpunit/phpunit (4.8.23) Downloading: 100% - Removing symfony/css-selector (v3.0.1) - Installing symfony/css-selector (v3.0.2) Downloading: 100% - Removing symfony/dom-crawler (v3.0.1) - Installing symfony/dom-crawler (v3.0.2) Downloading: 100% - Removing paragonie/random_compat (1.1.6) - Installing paragonie/random_compat (v1.2.0) Downloading: 100% - Removing symfony/console (v3.0.1) - Installing symfony/console (v3.0.2) Downloading: 100% - Removing symfony/finder (v3.0.1) - Installing symfony/finder (v3.0.2) Downloading: 100% - Removing symfony/debug (v3.0.1) - Installing symfony/debug (v3.0.2) Downloading: 100% - Removing symfony/http-foundation (v3.0.1) - Installing symfony/http-foundation (v3.0.2) Downloading: 100% - Removing symfony/event-dispatcher (v3.0.1) - Installing symfony/event-dispatcher (v3.0.2) Downloading: 100% - Removing symfony/http-kernel (v3.0.1) - Installing symfony/http-kernel (v3.0.2) Downloading: 100% - Removing symfony/process (v3.0.1) - Installing symfony/process (v3.0.2) Downloading: 100% - Updating symfony/routing (v3.0.1 => v3.0.2) The package has modified files: M .gitignore M Annotation/Route.php M CHANGELOG.md M CompiledRoute.php M Exception/ExceptionInterface.php M Exception/InvalidParameterException.php M Exception/MethodNotAllowedException.php M Exception/MissingMandatoryParametersException.php M Exception/ResourceNotFoundException.php M Exception/RouteNotFoundException.php-10 more files modified, choose "v" to view the full list Discard changes [y,n,v,d,s,?]? y Checking out 4686baa55a835e1c1ede9b86ba02415c8c8d6166 - Removing symfony/translation (v3.0.1) - Installing symfony/translation (v3.0.2) Downloading: 100% - Removing symfony/var-dumper (v3.0.1) - Installing symfony/var-dumper (v3.0.2) Downloading: 100% - Removing laravel/framework (v5.2.12) - Installing laravel/framework (v5.2.16) Downloading: 100% - Installing laravelcollective/html (v5.2.4) Downloading: 100%Writing lock fileGenerating autoload files> php artisan optimizeGenerating optimized class loader
3. after the update is successful, modify the config/app. php file to add the configuration:
# Add the providers array item 'Providers '=> [//... collective \ Html \ HtmlServiceProvider: class, //...], # add the alias array item 'aliases' => [//... 'form' => Collective \ Html \ FormFacade: class, 'html' => Collective \ Html \ HtmlFacade: class, //...],
Below is the complete version
'Providers '=> [/** Laravel Framework Service providers... */Illuminate \ Auth \ AuthServiceProvider: class, Illuminate \ Broadcasting \ BroadcastServiceProvider: class, Illuminate \ Bus \ BusServiceProvider: class, Illuminate \ Cache \ CacheServiceProvider: class, illuminate \ Foundation \ Providers \ lelesuppserviceserviceprovider: class, Illuminate \ Cookie \ response: class, Illuminate \ Database \ DatabaseServiceProvider: class, Illuminate \ Encryption \ EncryptionServiceProvider: class, illuminate \ Filesystem \ FilesystemServiceProvider: class, Illuminate \ Foundation \ Providers \ FoundationServiceProvider: class, Illuminate \ Hashing \ HashServiceProvider: class, Illuminate \ Mail \ MailServiceProvider: class, illuminate \ Pagination \ PaginationServiceProvider: class, Illuminate \ Pipeline: class, Illuminate \ Queue \ QueueServiceProvider: class, Illuminate \ Redis \ RedisServiceProvider: class, illuminate \ Auth \ Passwords \ PasswordResetServiceProvider: class, Illuminate \ Session \ SessionServiceProvider: class, Illuminate \ Translation \ TranslationServiceProvider: class, Illuminate \ Validation \ ValidationServiceProvider: class, illuminate \ View \ ViewServiceProvider: class, Collective \ Html \ HtmlServiceProvider: class, # Note: 'barryvdh \ LaravelIdeHelper \ idehelperserviceprovider ', // Laravel IDE helper/** Application Service Providers... */App \ Providers \ AppServiceProvider: class, App \ Providers \ AuthServiceProvider: class, App \ Providers \ EventServiceProvider: class, App \ Providers \ RouteServiceProvider: class,], /* | classes | Class Aliases | ------------------------------------------------------------------------ | This array of class aliases will be registered when this application | is started. however, feel free to register as your as you wish as | the aliases are "lazy" loaded so they don't hinder performance. | */'aliases' => ['app' => Illuminate \ Support \ Facades \ App: class, 'artism' => Illuminate \ Support \ Facades \ Artisan :: class, 'auth' => Illuminate \ Support \ Facades \ Auth: class, 'Blade '=> Illuminate \ Support \ Facades \ Blade: class, 'cache' => Illuminate \ Support \ Facades \ Cache: class, 'config' => Illuminate \ Support \ Facades \ Config: class, 'cookies' => Illuminate \ Support \ Facades \ Cookie: class, 'Crypt' => Illuminate \ Support \ Facades \ Crypt: class, 'DB' => Illuminate \ Support \ Facades \ DB: class, 'eloquent' => Illuminate \ Database \ Eloquent \ Model: class, 'event' => Illuminate \ Support \ Facades \ Event: class, 'file' => Illuminate \ Support \ Facades \ File: class, 'gate' => Illuminate \ Support \ Facades \ Gate: class, 'hash' => Illuminate \ Support \ Facades \ Hash: class, 'Lang '=> Illuminate \ Support \ Facades \ Lang: class, 'log' => Illuminate \ Support \ Facades \ Log: class, 'Mail' => Illuminate \ Support \ Facades \ Mail: class, 'password' => Illuminate \ Support \ Facades \ Password: class, 'queue '=> Illuminate \ Support \ Facades \ Queue: class, 'redirect' => Illuminate \ Support \ Facades \ Redirect: class, 'redis '=> Illuminate \ Support \ Facades \ Redis: class, 'request' => Illuminate \ Support \ Facades \ Request: class, 'response' => Illuminate \ Support \ Facades \ Response: class, 'Route '=> Illuminate \ Support \ Facades \ Route: class, 'scheme' => Illuminate \ Support \ Facades \ Schema: class, 'session' => Illuminate \ Support \ Facades \ Session: class, 'storage' => Illuminate \ Support \ Facades \ Storage: class, 'URL' => Illuminate \ Support \ Facades \ URL: class, 'validator' => Illuminate \ Support \ Facades \ Validator: class, 'View' => Illuminate \ Support \ Facades \ View: class, 'form' => Collective \ Html \ FormFacade: class, # Note: Here 'html' => Collective \ Html \ HtmlFacade: class, # note, here],
Reference File:
Https://laravel.com/docs/5.2/upgrade#upgrade-5.2.0
Https://laravelcollective.com/docs/5.1/html#installation
Http://stackoverflow.com/questions/34414389/fatalerrorexception-in-htmlserviceprovider-php-line-36-laravel
This article was created by Peter yuan and is licensed on the Chinese mainland using the signature-non-commercial use 2.5. You need to contact the author before reprinting and referencing, and sign the author and indicate the source of the article. An error occurred while calling the laravel 5.2 form module.