Installed class

composer require cedextech/trait-generator 

According to the instructions in config/app.php in the array of providers added

  Cedextech\TraitGenerator\ServiceProvider::class 

Well, it seems everything worked. But after a while set another class:

 composer require intervention/image 

and at the end of the installation composer gave an error

[Symfony \ Component \ Debug \ Exception \ FatalThrowableError] Class 'Cedextech \ TraitGenerator \ ServiceProvider' not found

tried: composer dump-autoload - did not help, php artisan dump-autoload gives the same error and any other command in the composer gives the same error

When I just go to the site also gives out

FatalThrowableError in ProviderRepository.php line 146: Class 'Cedextech \ TraitGenerator \ ServiceProvider' not found

What to do?? This is not the first time when it was before I just did not use the installed extension (there was another one), but the problem remained and you need to use extensions

  • composer dumpautoload -o && composer clearcache - try this option. - Kosta B.
  • Did you try to just inspect the library source? Maybe there really is no specified class? intervention/image works for me in several projects perfectly without complaints - Maxim
  • @KostaB., It seems your version worked, thanks! - Ivan
  • @Maxik, specifically there is no problem with intervention / image, it was a problem in general - Ivan

1 answer 1

This is the team that should work:

 composer dumpautoload -o && composer clearcache 
  • So it worked, thanks - Ivan