With Laravel 5, many inbuilt components that were part of core framework has been removed and are been managed independently as Laravel Collective. So If you are having an old version web application built in Laravel and if you are trying to move it into newer version you might get following error / exceptions.

  • Class 'Form' not found
  • FatalErrorException Call to undefined function link_to()

Or even if you are building a new Laravel Application with new version you might want to take advantage of some good inbuilt function that Laravel Collective Package provides. Here is how you install it.

Step 1. Add Dependency in composer.json

Go to your composer.json file of project and add following dependency inside require section.

"laravelcollective/html":"^5.4.0"

 

Go yo your terminal and run composer update or composer update laravelcollective/html (To download the specific package).

Step 2 Add the Form and HTML facades and service provider.

Edit file app/config/app.php and add this line to providers array

Collective\Html\HtmlServiceProvider::class

Add the following aliases to aliases array in the same file.

'Form' => Collective\Html\FormFacade::class,
'Html' => Collective\Html\HtmlFacade::class,
Comments