Hello Guys,
Facing this issue and struggling to find the cause?, okay then lets direct jump in to the fix I found or more precisely mistake I found!
In my case I was wrapped the loading on controller in web.php route with single quotes!
Line of code causing this error:
Route::get('/book-readings/upload-photos', ['App\Http\Controllers\BookReadingController::class', 'uploadPhotos']);
Very carefully watch in above code code was wrapped in quotes: ‘App\Http\Controllers\BookReadingController::class’,
Controller should be loaded without single quotes;
And second important reason is it, this line should shall fall before the resource route if you have similar to this controller, in my case it was :
Route::resource('/book-readings', App\Http\Controllers\BookReadingController::class);
// this line was defined before the above route I wanted to work! (I am not sure why this line causing to stop showing the page :/)
Finally I make these changes so everything started working smoothly & all routes loading fine and up!.
// Upload Audio Files:
Route::get('/book-readings/upload-photos', [App\Http\Controllers\BookReadingController::class, 'showPhotos'])->name('book-readings.upload-photos');
Route::post('/book-readings/upload-photos', [App\Http\Controllers\BookReadingController::class, 'uploadPhotos']);
Route::delete('/book-readings/upload-photos/{id}', [App\Http\Controllers\BookReadingController::class, 'destroyPhoto']);
Route::resource('/book-readings', App\Http\Controllers\BookReadingController::class);
Hope this will give you a hint to point the issue you might come up like this mostly when we are new and learning and developing new things!
Happy Learnings
In today’s fast-paced work environment, meetings are essential but can often feel unproductive. However, by…
Gold is one of the most coveted precious metals in the world, adored for its…
Gold, the shimmering metal synonymous with wealth, power, and beauty, has been deeply intertwined with…
How to Onboard an Intern in a Small, Individual-Based Company Hiring an intern can be…