Support the ongoing development of Laravel.io →
Requests Forms
Last updated 2 years ago.
0

A route simply connects a request method and a url to a controller method. If you have a controller method and no route, then where will the form submit to? When you specify the action, it does a reverse lookup of the route that you specified for it, then it just echoes that url/route in the html, like a regular html, form action, as HTML does not understand SignupController@Register.

How are you stuck? "I can't define a route like I did for the other form, because newPost doesn't have any url associated with it" --- this is because you haven't associated a url with it. This is what routes do. Do the exact same thing you did with your other routes. Specify a path as the first argument, and an array as the second argument with your controller method and optionally (recommended), a custom name for your route (usually the same as the URI but with dots, or slashes).

http://laravel.com/docs/routing ... see named routes

Last updated 2 years ago.
0

Thanks for the quick reply. I didn't know the reverse lookup part before, but now it all makes sense and I got it working.

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.