I am getting 404 not found when returning view from my controller. This is web.php :
Route::get('/', [MoviesController::class, 'index'])->name('movies.index');
Route::get('/movies/{movie}', [MoviesController::class, 'show'])->name('movies.show')
This is the controller function :
public function show($id)
{
$movie = Http::withToken(config('services.tmdb.token'))
->get('https://api.themoviedb.org/3/movie/'.$id)
->json();
dump($movie);
return view('show', [
'movie' => $movie,
]);
}
And here is how i am linking it in my blade file :
<a href="{{ route('movies.show', $movie['id']) }}">
i have checked
php artisan route:list
and the route exists. ** Laravel version : 8.x
My url was wrong. I changed it from "localhost/MovieDemo2/Public/movies/671039" To "localhost/MovieDemo2/public/movies/671039" Silly mistake.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments