Class 'Mpociot\ApiDoc\ApiDocGeneratorServiceProvider' not found - laravel

I am currently working on L5.5 and there for generating api docs I have installed this package, now I don't need that package I decided to uninstall it but while doing uninstalling I got this error.
Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> #php artisan package:discover
[Symfony\Component\Debug\Exception\FatalThrowableError]
Class 'Mpociot\ApiDoc\ApiDocGeneratorServiceProvider' not found
Script #php artisan package:discover handling the post-autoload-dump event returned with error code 1
I checked on repo's issue and on net but haven't got satisfying answer.
I uninstalled this repo by doing following this
remove repo from composer.json and then I ran the command composer update.
Any idea why it is appearing and how to fix this error??
Thank you for your efforts :)
I have removed the mentioned file still I am getting this error

Go to config/app.php and make sure you removed
Mpociot\ApiDoc\ApiDocGeneratorServiceProvider::class
from this. Now run:
php artisan clear-compiled
and
php artisan config:clear
to make sure you are not using any cache. After that there shouldn't be any problems
NOTE
if you are getting this issue even after this then go to bootstrap/cache/config.php as mentioned by Marcin NabiaƂek down there in comments and in that delete Mpociot\ApiDoc\ApiDocGeneratorServiceProvider::class from the array of providers after that rerun the above three commands.

Related

How to clear cache Laravel?

I tried these commands:
php artisan config:cache
php artisan route:cache
php artisan cache:clear
All of them return me error:
Class 'App\Providers\InvitationServiceProvider' not found
But I dont have InvitationServiceProvider anywhere in project.
So, how to rebuild Laravel?
Also I tried composer dump and php artisan serve
Dump is:
PS C:\Projects\secure> composer dump-autoload -o
Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> #php artisan package:discover --ansi
In ProviderRepository.php line 208:
Class 'App\Providers\InvitationServiceProvider' not found
Script #php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 1
The correct name of the command is
composer dump-autoload
Don't know if you tried that one.
And also the service providers are usually registered within the config\app.php providers array, so take a look in that file and remove it from there too.
Or remove manually the bootstrap\cache\packages.php file.
EDIT:
From your dump it is obvious that you have the service provider registered in the config app file, so you tried to cache the config, try to clear the cache if you haven't tried the manual way yet:
php artisan config:clear
I would really appreciate comments after someone downvotes an answer, this way I don't understand what is wrong in the answer.
Try it
Make sure :
You have a file named InvitationServiceProvider inside App\InvitationServiceProvider.
The class InvitationServiceProvider is namespaced correctly.
You didn't change the app namespace.
//after that run the bellow comments
composer dump-autoload or composer update
You have tried registering your provider under 'providers' array of /app/cofig/app.php
and then You have to do this do a
composer dump-autoload -o

How to remove ckeditor package (error: Class 'Ckeditor\CkeditorServiceProvider' not found)?

I followed the steps mentioned here:
How to remove a package from Laravel using composer?
including the step: Remove Service Provider from "app/config/app.php" (reference in "providers" array)
However, since I got an error:
In ProviderRepository.php line 208:
Class 'Ckeditor\CkeditorServiceProvider' not found
Script #php artisan package:discover handling the post-autoload-dump event returned with error code 1
The app is down and I cannot do any operation in terminal. How to get rid of the reference to this class?
Then run these commands.
php artisan cache:clear
composer dump-autoload -o
If an error occurs while clearing cache, then delete cache files under bootstrap/cache manually.

Error Updating Laravel 5.4 to 5.5

Method Illuminate\Foundation\ComposerScripts::postAutoloadDump is not callable, can not call post-autoload-dump script
#php artisan package:discover
There are no commands defined in the "package" namespace.
Script #php artisan package:discover handling the post-autoload-dump event returned with error code 1
This would normally happen if the version of laravel in your composer.json file is under 5.5.
You will want to make sure you have:
"laravel/framework": "5.5.*",
In the require portion of the json. Sometimes, if you update through composer, it will load the package from the cache. You might want to delete your $PROJECT_DIR/vendor/* folder and then run:
composer update --prefer-source
Notice the output to see that laravel/framework is indeed at 5.5.*.

anyone got an error i get while installing teepluss/theme in laravel

I wanted to install teepluss/theme so I added it to my composer.json
but now I get this error:
[Symfony\Component\Debug\Exception\FatalThrowableError]
Class 'SuperClosure\Serializer' not found
I was capable to solve the first error by adding >"jeremeamia/superclosure": "^2.0"
but now when I add >Teepluss\Theme\ThemeServiceProvider::class, in app.php providers I get a new error :
> [ErrorException] Illegal offset type in unset
here's what i got in the script in composer.json
If you already run composer update, you can try run this script
php artisan config:cache
and
php artisan cache:clear.It can help you resolve that problem

Script php artisan optimize handling the post-install-cmd event returned with error code 255

After clone the git repo, install composer and Laravel , this error will come out. Anyone can solve this error?
When I run laravel new, I get this error:
Crafting application...
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Nothing to install or update
Generating autoload files
> php -r "file_exists('.env') || copy('.env.example', '.env');"
> Illuminate\Foundation\ComposerScripts::postInstall
> php artisan optimize
Script php artisan optimize handling the post-install-cmd event returned with error code 255
Application ready! Build something amazing.
Which repo you cloned? if you want create a new laravel project, just try run laravel new projectName,
check the doc here

Resources