0

I downloaded a laravel project online from link I ran the command is composer update and composer install. The error i'm seeing is:

In ProviderRepository.php line 208:

Class "Collective\Html\HtmlServiceProvider" not found

Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 1

After deleting vendor file and running composer install and composer update im getting this

PHP Fatal error: Declaration of App\Providers\EventServiceProvider::boot(Illuminate\Contracts\Events\Dispatcher $events) must be compatible with Illuminate\Foundation\Support\Providers\EventServiceProvider::boot() in C:\xampp\htdocs\ZAlert\app\Providers\EventServiceProvider.php on line 27 In EventServiceProvider.php line 27:

Declaration of App\Providers\EventServiceProvider::boot(Illuminate\Contracts\Events\Dispatcher $events) must be compatible with Illuminate\Foundation\Support\Providers\EventServiceProvider::boot()

Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 255

I was expecting this to run in laravel 9

James Z
  • 12,209
  • 10
  • 24
  • 44
KHAN_047
  • 1
  • 2
  • does this answer your question: https://stackoverflow.com/a/32795685/9077347 – Ibrahim Hammed Nov 26 '22 at 10:51
  • `composer update` updates your dependencies to the latest version which is compatible with your env. I recommend to remove `vendor` directory then just run `composer install`. – Hamid Haghdoost Nov 26 '22 at 10:57
  • @HamidHaghdoost i did what you've written but same error is being displayed again – KHAN_047 Nov 26 '22 at 11:17
  • @IbrahimHammed It did not solved my issus now its showing `Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 255` – KHAN_047 Nov 26 '22 at 11:35

2 Answers2

0

Add this line to your service provider php file

Class"Collective\Html\HtmlServiceProvider

"

  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Nov 29 '22 at 10:50
0

It looks like this library missed in your composer.json or you didn't run composer install Please follow the nexts steps: 1 - require the package in "composer.json" :

"laravelcollective/html": "~5.0" check the right version for your project 

2 - Run

composer install 

3 - Add this to config/app.php providers array :

'Collective\Html\HtmlServiceProvider',

4- And this to the aliases array :

 'Form' => 'Collective\Html\FormFacade',
 'Html' => 'Collective\Html\HtmlFacade',

5- optional step

composer dump -o 

that should resolve your issue , let me know if you need any help

Aian
  • 226
  • 3
  • 10