0
votes

I've read other issues about "ReflectionException Class ClassName does not exist" which refers to database seeders. I tried solutions from these questions and they didn't solve problem.

I've run into problem when tried to create model with command php artisan make:model Country (I've already had countries table)

after that I constantly get error

vagrant@homestead:~/Code/l53$ php artisan

[ReflectionException]
Class Country does not exist

What I did after that:

  1. created Country model manually http://joxi.ru/YmEyoL7CVNL0m6
  2. added path to classmap http://joxi.ru/J2b4QvLc1dMgr6
  3. run:

    composer update --no-scripts
    composer dump-autoload -o
    sudo composer self-update
    
  4. deleted bootstrap/cache/services.php (there was only this file)

After every of these steps after running 'php artisan' I still receive:

[ReflectionException]
Class Country does not exist

and after running composer update I receive:

vagrant@homestead:~/Code/l53$ composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Generating autoload files
Illuminate\Foundation\ComposerScripts::postUpdate

php artisan optimize

[ReflectionException]
Class Country does not exist

Script php artisan optimize handling the post-update-cmd event returned with error code 1

Any help is appreciated. Thanks in advance.

P.S. I use laravel 5.3 via homestead

1
I tried solutions from that question and results you can see in my questionAlexandr

1 Answers

0
votes

I tried to remove vendor folder and 'composer update' (which recreated it) which didn't help. but after 'vagrant reload' it (php artisan) worked... strange issue)