Sunday, 12 February 2017

Call to undefined method Illuminate \ Foundation \ Application ::bindShared()

Call to undefined method Illuminate \ Foundation \ Application ::bindShared()


To Fix this remove the outdated package "illuminate/html": "^5.0" and replace with new Laravel collective package as shown below
Đối vớ laravel 5.4
 "laravelcollective/html": "5.3.*"

Step 1: Remove "illuminate/html": "^5.0" from composer JSON

  1. //Remove from composer.json
  2. "illuminate/html": "^5.0",
  3.  
  4. //Remove service providerfrom config/app
  5. 'Illuminate\Html\HtmlServiceProvider'
  6.  
  7. //Remove aliases from config/app
  8. 'Form'=> 'Illuminate\Html\FormFacade',
  9. 'HTML'=> 'Illuminate\Html\HtmlFacade',

Step 2: Update composer.json with "laravelcollective/html": "5.2.*"

  1. {
  2. "name": "laravel/laravel",
  3. "description": "The Laravel Framework.",
  4. "keywords": ["framework", "laravel"],
  5. "license": "MIT",
  6. "type": "project",
  7. "require": {
  8. "php": ">=5.5.9",
  9. "laravel/framework": "5.2.*",
  10. "laravelcollective/html": "5.2.*"
  11. },
  12. }

Step 3: Update composer

  1. composer update

Step 4: Register new providers and aliases on config/app.php

  1. //Provider
  2. Collective\Html\HtmlServiceProvider::class
  3.  
  4. //Aliases
  5. 'Form' => Collective\Html\FormFacade::class,
  6. 'Html' => Collective\Html\HtmlFacade::class,
http://www.phplab.info/categories/laravel/call-to-undefined-method-illuminate-foundation-application-bindshared

No comments:

Post a Comment