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 !!!
CodePudding user response:
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
CodePudding user response:
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.