Skip to content
Advertisement

Laravel 5.8: POST Route Does Not Seem To Be Working

I’m using Laravel 5.8 for my project and in this project, I have added this route:

JavaScript

And here is the form:

JavaScript

And at the Controller, I added this:

dd($request);

But I don’t know why nothing appears as result. I mean the page just refreshes without showing any error or any dd result.

So what’s going wrong here? How can I solve this issue?

Advertisement

Answer

Try to simplify everything:

JavaScript

In your controller:

JavaScript

Once you are at this point, you can start adding validations, policies or dynamic parameters in your form (for instance last(request()->segments())) .

By proceeding step by step, you will quickly find where is the problem.

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