繁体   English   中英

Laravel | 加载资源失败:服务器响应状态为 404(未找到)

[英]Laravel | Failed to load resource: the server responded with a status of 404 (Not Found)

当我尝试制作 url 时,会出现这个问题

加载资源失败:服务器响应状态为 404(未找到)

Route::get('/doctor/{doctorId}', [App\Http\Controllers\DoctorController::class, 'services'])->name('doctor.profile');

如果我从其他没有 id 的 url 查看页面,我知道这很奇怪,我不知道为什么!!!

试试这个,这将生成 Method、URI 和 Action Class did you registered。

php artisan route:list --compact

如果您还没有找到您的 URI '/doctor/{doctorId}' ,那么输入这个

php artisan route:cache

如果找不到 model,通常会显示 404 消息。

$model = SomeModel::find(doctorId)

dd($model)

导致 dd = null / hense 错误。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM