简体   繁体   中英

Laravel throws ReflectionException: Class config does not exist

(I know you may think this is a duplicate question but I really believe its not)

I am working on an API using Laravel and I had the code all sorted out and running. However out of the blues I run my test on day and I get

ReflectionException: Class config does not exist

whenever I try to store a new Model I updated Laravel to 5.7 but the problem persisted Then I thought this was a problem with the Database but

php artisan migrate

creates database tables successfully. Running out of time.

Try

php artisan clear-compiled

If it does not solve the issue then read this thread https://github.com/laravel/dusk/issues/99 and https://github.com/laravel/framework/issues/9733

The issue seems to be with phpunit 6.0:

https://github.com/laravel/dusk/issues/99

I suggest upgrading to php7.x and the latest phpunit. (I know. A pain, but there are great tutorials out there for the upgrade and if you follow them step by step, you will have it done in under a half hour.)

For me the issue was with the dependencies. What worked for me was to completely remove the vendor directory and do a composer update to re-install the dependencies and vendor packages.

Deleting files in the project/bootstrap/cache/ and then running:

$php artisan clear-compiled

solved my problem!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM