1

I'm using laravel 5.5 and I want to install laravelcollective without using composer. I have followed steps mentioned in other questions to install it in laravel 5.2 but it is generating the following error. Class Collective\Html\HtmlServiceProvider not found

Please suggest the possible reasons for the error.

2 Answers2

1

Shashank Simha M R, I think the best way to go is by installing it via composer like this: composer require laravelcollective/html "5.5.*". Here, you just specify the version of the Laravel you've installed. Otherwise, composer will not be able to install it.

After that, you just update the config/app.php file like so:

  1. Add the following line to the $provider array: Collective\Html\HtmlServiceProvider::class
  2. Then find the aliases array and add these two aliases to the aliases array: 'Form' => Collective\Html\FormFacade::class, 'Html' => Collective\Html\HtmlFacade::class,

            That is it!
    
f.khantsis
  • 3,256
  • 5
  • 50
  • 67
Capfer
  • 829
  • 9
  • 22
0

Go to this link:

https://github.com/LaravelCollective/html

download the package and extract it to /vendor/ folder so that you have this path

/vendor/laravelcollective/html/src/HtmlServiceProvider.php

Next, add your new provider to the providers array of config/app.php:

  'providers' => [
    // ...
    Collective\Html\HtmlServiceProvider::class,
    // ...
  ],

Finally, add two class aliases to the aliases array of config/app.php:

  'aliases' => [
    // ...
      'Form' => Collective\Html\FormFacade::class,
      'Html' => Collective\Html\HtmlFacade::class,
    // ...
  ],

And it should work.

lewis4u
  • 14,256
  • 18
  • 107
  • 148