Reputation: 429
I use the standard authentication mechanism in Laravel.
Route path is:
Route::post('auth/register', 'Auth\AuthController@postRegister');
HTML form is:
<form method="POST" action="/auth/register">
When I submit form I get 404 error.
But path for GET methos works:
Route::get('auth/register', 'Auth\AuthController@getRegister');
Upvotes: 0
Views: 86
Reputation: 5294
Use Laravel's helper function url()
to generate an absolute URL. In your case the code would be:
<form method="POST" action="{{ url('auth/login') }}">
You could also check out the laravelcollective forms package. These classes were removed from the core after L4. This way you could build HTML forms using PHP only:
echo Form::open(['url' => 'auth/login', 'method' => 'post'])
Upvotes: 1
Reputation: 1136
you can use {{ URL::route('register') }} function in the action method. In This case the method will be:
action="{{ URL::route('register') }}"
and your route file will be: `
Route::get('auth/register',array('as' =>'register' ,'uses' => 'Auth\AuthController@getRegister'));
Route::post('auth/register', array('as' =>'register' ,'uses' =>'Auth\AuthController@postRegister'));
`
Upvotes: 0