As soon, I am typing php artisan db:seed
command.
I\'m getting Error Like:
[ReflectionException]
Clas
Not strictly related to the question but received the error ReflectionException: Class config does not exist
I had added a new .env
variable with spaces in it. Running php artisan config:clear
told me that any .env
variable with spaces in it should be surrounded by "
s.
Did this and my application stated working again, no need for config clear as still in development on Laravel Homestead (5.4)
composer update
Above command worked for me.
Whenever you make new migration in la-ravel you need to refresh classmap
in composer.json
file .
For some reason I had to run composer dumpautoload -o
. Notice flag -o
which mean with optimization. I don't have any idea why it works only with it but give it a try. Perhaps it helps someone.
composer dump-autoload
php artisan config:clear
php artisan cache:clear
This will surely work. If not then, you need to do
composer update
and then, the aforementioned commands.
composer dump-autoload
this will fix it
Usually error message ReflectionException: Class app does not exist
appears in larval test when you forget to close connection.
if you're using setUp or tearDown function in your test do not forget to close connection by calling parent::setUp
and parent::tearDown
public function setUp()
{
parent::setUp();
}
public function tearDown()
{
parent::tearDown();
}