助手内部的laravel调试显示我\ app \用户类未找到
我正在尝试使用Xdebug在Laravel中进行第一次调试,并且当我设置断点并尝试在\ app \ user
时尝试介绍一下,模型在调用它显示了我在下面附加的class class class classive mode n the Indy caste Inder clange Inder It saving me class图像:
这是我的启动.json文件
{
"version":"0.2.0",
"configurations": [
{
"name": "Listen for XDebug",
"type": "php",
"request": "launch",
"port": 9000,
"pathMappings": {
"/opt/lampp/htdocs/investproTheme": "${workspaceRoot}",
},
// add this
"ignore": [
"**/vendor/**/*.php"
],
},
{
"name": "Launch currently open script",
"type": "php",
"request": "launch",
"program": "${file}",
"cwd": "${fileDirname}",
"port": 9001
}
] }
I'm trying my first debug in Laravel using Xdebug and when I set the breakpoint and try to step over when \App\User
model is calling it shows me class not found error which I attached in the below image:
this is my launch.json file below
{
"version":"0.2.0",
"configurations": [
{
"name": "Listen for XDebug",
"type": "php",
"request": "launch",
"port": 9000,
"pathMappings": {
"/opt/lampp/htdocs/investproTheme": "${workspaceRoot}",
},
// add this
"ignore": [
"**/vendor/**/*.php"
],
},
{
"name": "Launch currently open script",
"type": "php",
"request": "launch",
"program": "${file}",
"cwd": "${fileDirname}",
"port": 9001
}
] }
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您使用的是Laravel 8或9 ,则错误地引用了用户模型,因此请尝试以下操作:
还记得用建议的方式替换所有
\ app \ user
呼叫!重新运行的作曲家自动加载程序
有时不跟踪某些拼写器,因此自动加载程序不会让它们工作,在这种情况下,请在控制台中尝试一下:
Composer dump-autoload
If you are using Laravel 8 or 9, you are wrongly referencing the User Model so try this:
Also remember to replace all
\App\User
calls with suggested way!Re-run composer auto-loader
Sometimes composer don't track some clases so the auto loader wont get them to work, in that case try this in the console:
composer dump-autoload