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.
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
Add the following aliases to aliases array in the same file.
‘Html’ => Collective\Html\HtmlFacade::class,
2 comments On Installing Laravel Collective Package on Laravel 5.5
Very useful. Thanks for sharing
manikyarao@sravani-adminpc-HP-ProBook-440-G4:/var/www/html/mani/blog$ composer update laravelcollective/html
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
– laravel/framework v5.5.28 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system
.
– laravel/framework v5.5.28 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system
.
– laravel/framework v5.5.28 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system
.
– Installation request for laravel/framework (locked at v5.5.28, required as 5.5.*) -> satisfiable by laravel/framework
[v5.5.28].
To enable extensions, verify that they are enabled in your .ini files:
– /etc/php/7.0/cli/php.ini
– /etc/php/7.0/cli/conf.d/10-mysqlnd.ini
– /etc/php/7.0/cli/conf.d/10-opcache.ini
– /etc/php/7.0/cli/conf.d/10-pdo.ini
– /etc/php/7.0/cli/conf.d/15-xml.ini
– /etc/php/7.0/cli/conf.d/20-calendar.ini
– /etc/php/7.0/cli/conf.d/20-ctype.ini
– /etc/php/7.0/cli/conf.d/20-curl.ini
– /etc/php/7.0/cli/conf.d/20-dom.ini
– /etc/php/7.0/cli/conf.d/20-exif.ini
– /etc/php/7.0/cli/conf.d/20-fileinfo.ini
– /etc/php/7.0/cli/conf.d/20-ftp.ini
– /etc/php/7.0/cli/conf.d/20-gettext.ini
– /etc/php/7.0/cli/conf.d/20-iconv.ini
– /etc/php/7.0/cli/conf.d/20-json.ini
– /etc/php/7.0/cli/conf.d/20-mysqli.ini
– /etc/php/7.0/cli/conf.d/20-pdo_mysql.ini
– /etc/php/7.0/cli/conf.d/20-phar.ini
– /etc/php/7.0/cli/conf.d/20-posix.ini
– /etc/php/7.0/cli/conf.d/20-readline.ini
– /etc/php/7.0/cli/conf.d/20-shmop.ini
– /etc/php/7.0/cli/conf.d/20-simplexml.ini
– /etc/php/7.0/cli/conf.d/20-sockets.ini
– /etc/php/7.0/cli/conf.d/20-sysvmsg.ini
– /etc/php/7.0/cli/conf.d/20-sysvsem.ini
– /etc/php/7.0/cli/conf.d/20-sysvshm.ini
– /etc/php/7.0/cli/conf.d/20-tokenizer.ini
– /etc/php/7.0/cli/conf.d/20-wddx.ini
– /etc/php/7.0/cli/conf.d/20-xmlreader.ini
– /etc/php/7.0/cli/conf.d/20-xmlwriter.ini
– /etc/php/7.0/cli/conf.d/20-xsl.ini
You can also run `php –ini` inside terminal to see which files are used by PHP in CLI mode.
i am done the above process i get the below result