简体   繁体   中英

laravel ReflectionException Class Country does not exist

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.

PS I use laravel 5.3 via homestead

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)

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