Look at the routes below
+--------+-----------------------------+----------------+--------------------------+----------------+---------------+
| Domain | URI | Name | Action | Before Filters | After Filters |
+--------+-----------------------------+----------------+--------------------------+----------------+---------------+
| | GET|HEAD users | users.index | UsersController@index | | |
| | GET|HEAD users/create | users.create | UsersController@create | | |
Why is create
a GET method instead of a POST? What I'm trying to do is to request to /users/create
from /register controller to sign up a new user, but that create
method doesn't seem to be what it looks like it is...
Am I missing something?
The GET users/create
route is for getting a page displaying a form to create a new user.
To actually create the new user, you'll want to POST
directly to the users
route.
That'll call the store
method in your controller, where you should create the user in your DB.