“找不到类";即使在转储自动加载后发生错误? [英] "Class not found" error even after dump-autoload?

查看:65
本文介绍了“找不到类";即使在转储自动加载后发生错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在新创建的模型中,我不断收到找不到类"错误.我知道语法绝对正确.我多次检查了该变量,并复制并粘贴了变量以避免拼写错误.

I keep getting the "Class not found" error with newly created models. I know the syntax is absolutely correct. I went over it multiple times and I copied and pasted variables to avoid spelling errors.

我也参加了

php artisan dump-autoload

多次,但仍然没有运气.这会在每个文件中发生,并且只会在新创建的模型中发生.

mulitple times, but still no luck. This happens in every file, and it only happens to the newly created models.

推荐答案

尝试改用composer.

php composer dump-autoload

如果不生成模型,请不要忘记在 composer.json 中的 autoload 处添加文件夹.

If you are not generating the models don't forget to add the folder in the composer.json at autoload if it isn't.

这篇关于“找不到类";即使在转储自动加载后发生错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆