laravel throwing MethodNotAllowedHttpException

I am trying to get something very basic running. I am used to CI and now learning Laravel 4, and their docs are not making it easy! Anyways, I am trying to create a login form and just make sure that data is posted successfully by printing it in the next form. I am getting this exception:

Symfony \ Component \ HttpKernel \ Exception \ MethodNotAllowedHttpException

and my MemberController.php:

    public function index()
    {
        if (Session::has('userToken'))
        {
            /*Retrieve data of user from DB using token & Load view*/
            return View::make('members/profile');
        }else{
            return View::make('members/login');
        }
    }

    public function validateCredentials()
    {
        if(Input::post())
        {
            $email = Input::post('email');
            $password = Input::post('password');
            return "Email: " . $email . " and Password: " . $password;
        }else{
            return View::make('members/login');
        }
    }

and routes has:

Route::get('/', function()
{
    return View::make('hello');
});

Route::get('/members', '[email protected]');
Route::get('/validate', '[email protected]');

and finally my view login.php has this form direction:

<?php echo Form::open(array('action' => '[email protected]')); ?>

Any help will be greatly appreciated.

Leave a Comment