laravel throwing MethodNotAllowedHttpException

0 votes

 I wanted to create a login form and make sure that data is posted successfully by printing it in the next form. But  I am getting this exception:

Symfony \ Component \ HttpKernel \ Exception \ MethodNotAllowedHttpException

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');
        }
    }

The routes has:

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

Route::get('/members', 'MemberController@index');
Route::get('/validate', 'MemberController@validateCredentials');

The view login.php has this form direction:

<?php echo Form::open(array('action' => 'MemberController@validateCredentials')); ?>

Can someone help me solve this?

May 17 in Others by Kichu
• 19,040 points
39 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In Others

0 votes
0 answers

Self Created Laravel Link Not Working

I installed laravel 6.0 through composer and ...READ MORE

Dec 3, 2019 in Others by anonymous
• 120 points
213 views
0 votes
1 answer

count() parameter must be an array or an object that implements countable in laravel

You will have to make one change ...READ MORE

answered Feb 10 in Others by Rahul
• 8,980 points
223 views
0 votes
1 answer

Laravel 8 routes to controllers. SEO friendly URL structure

use regex to match the slugs  again use ...READ MORE

answered Feb 17 in Others by narikkadan
• 10,640 points
127 views
0 votes
1 answer

Laravel - Connection could not be established with host smtp.gmail.com [ #0]

While using the Laravel project directory, edit ...READ MORE

answered Feb 22 in Others by Aditya
• 7,280 points
498 views
0 votes
1 answer

Laravel , Blade & React js add the meta tag for rendering on server side SEO

use septia laravel side rendering and add ...READ MORE

answered Feb 24 in Others by narikkadan
• 10,640 points
103 views
0 votes
0 answers

Could not open input file: artisan

I got this error on CLI while ...READ MORE

Apr 30 in Other DevOps Questions by Kichu
• 19,040 points
75 views
0 votes
0 answers

How can I remove a package from Laravel using PHP Composer?

What is the best way to remove ...READ MORE

2 days ago in PHP by narikkadan
• 10,640 points
5 views
0 votes
2 answers

Laravel 5.4 to get data form API response

Input::get('var_name') READ MORE

answered Feb 14, 2019 in Blockchain by anonymous
941 views
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP