0

I just moved my register to the front page of my website. My routes are like this:

   Route::controller('/user', 'UserController');
   Route::controller('/page', 'PageController');

   Route::controller('/', 'HomeController');

When I post on the form it doesn't execute the postIndex() method in my HomeController for some reason. I can't figure out why. It's just a return statement with some text for now to test.

My form looks like this

    {{ Form::open(array('url' => '/', 'class'=>'form', 'role' => 'form', 'id' => 'register-form')) }}
        {{ Form::text('username', $value = null, array('placeholder' => 'Username', 'class'=> 'form-control', 'required' => 'required', 'autofocus' => 'autofocus' )) }}
        {{ Form::password('password', array('placeholder' => 'Password', 'class' => 'form-control', 'id'=>'password', 'required' => 'required')) }}
        {{ Form::text('email', $value = null, array('placeholder' => 'Email', 'class'=> 'form-control', 'required' => 'required')) }}
    {{ Form::submit('Sign up', array('class' => 'btn btn-danger btn-default')) }}

1 Answer 1

2

Try adding the HTTP method to your form. Without it defined, and no route used, it should default to GET, but you want POST.

{{ Form::open(array('url' => '/', 'method' => 'post', 'class'=>'form', 'role' => 'form', 'id' => 'register-form')) }}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.