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
Break! I didn’t plan it. One day I just didn’t feel like opening Instagram—and then…
AI tools Let’s be real—AI sounds like either a robot apocalypse or something only tech…
Summer vacation is a great time for kids to explore, have fun, and learn new…
Goal: Understand transformers, large language models, and the architecture behind ChatGPT. Tutorial Suggestions: ✅ “Transformers…
Goal: Build apps or tools with ChatGPT or GPT-4 API. Tutorial Suggestions: ✅ OpenAI API…
Goal: Learn how to prompt better, write content, brainstorm, code, etc. Tutorial Suggestions: ✅ OpenAI's…