"Class not found" error even after autoload dump?

I keep getting a “Class not found” error with newly created models. I know that the syntax is absolutely correct. I iterated over it several times, and I copied and pasted variables to avoid spelling errors.

I also ran

php artisan dump-autoload

mulitple times, but still no luck. This happens in every file, and this only happens with newly created models.

0
source share
1 answer

Try using it instead composer.

php composer dump-autoload

If you are not creating models, be sure to add the folder in composer.json to autoload if it is not.

+1
source

Source: https://habr.com/ru/post/1607121/


All Articles