简体   繁体   中英

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

When I try to make url like that which have an id this problem occur

Failed to load resource: the server responded with a status of 404 (Not Found)

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

if i view the page from other url which have no id it work i know that's strange and i have no idea why !!!

Try this, this will generate Method, URI, and Action Class did you registered.

php artisan route:list --compact

If you have not found your URI '/doctor/{doctorId}' , then enter this

php artisan route:cache

A 404 message is usually displayed if the model can't be found.

$model = SomeModel::find(doctorId)

dd($model)

result in the dd = null / hense the error.

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