Search code examples
laravellaravel-5composer-phplaravel-5.5laravel-artisan

Laravel5.5 after use php artisan app:name Class not found


I am new developer on Laravel, now I'm using Laravel version 5.5

I got the problem after used php artisan app:name on my project, I got the problem:

In ProviderRepository.php line 208: Class 'App\Providers\AppServiceProvider' not found

as the captured image below:

enter image description here

As this error, I can not use php artisan commands or composer commands anymore can you guys please help me to solve this problem I am really appreciated for time. Thanks you

Best Regards Siripong Gaewmaneechot


Solution

  • I would suggest looking in your config files, and the main classes which were generated when you started your laravel project (User class, etc) because they are all set to App\User App..... etc.

    So for example, in the image you have in the question, it says it can not find App\AppProviders... - This indicates that somewhere you still have a use statement pointed to App\AppProviders.. but you changed the app name, so it's no longer App. something I do if I made that mistake, is I do a global search in my project files for App\ (you may need to put App\\ in the search because \ is an escape character

    So if you did not change the app name immediately after starting the project, some of the paths will not be pointing to the correct directories. Let me know if that makes sense.