Skip to content
Advertisement

How can I corrrect 404 NOT FOUND error, resulting from a view, route, controller scheme in Laravel 8?

I am seeing 404 NOT FOUND page after trying the code below,

Here is my blade code,

JavaScript

Here is my route, the route has a prefix called admin

JavaScript

Here is my controller class, which is initially generated as a resource, however for the purpose of deleting a row from the database, a new function called delete is introduced manually. Therefore I am not using the destroy function. I am not introducing a delete method yet, so that I can see the $id on a new page as a test.

JavaScript

As you can see above, I am not introducing a delete method yet so that I can see the $id on a new page.. Also when I hower the mouse on the delete link object and click on it, it shows me localhost:8000/admin/deletearticle/9 on the browser, which is correct. But the page is 404 NOT FOUND .

I would be greatful to hear from you, if you have an idea about this problem.

Advertisement

Answer

Route parameters don’t have a $ in their name. {id} not {$id}.

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement