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, 2022 in Others by Kichu
• 19,040 points
1,500 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
809 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, 2022 in Others by Rahul
• 9,680 points
6,674 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, 2022 in Others by narikkadan
• 63,600 points
1,464 views
0 votes
1 answer
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, 2022 in Others by Aditya
• 7,680 points
14,753 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, 2022 in Others by narikkadan
• 63,600 points
1,657 views
0 votes
1 answer

Could not open input file: artisan

This error happens because you didn't install ...READ MORE

answered May 1, 2022 in Other DevOps Questions by narikkadan
• 63,600 points
9,546 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

Jun 25, 2022 in PHP by narikkadan
• 63,600 points
545 views
0 votes
0 answers

PHP Composer update "cannot allocate memory" error (using Laravel 4)

I'm on Linode 1G RAM basic plan. ...READ MORE

Jun 27, 2022 in PHP by narikkadan
• 63,600 points
984 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
1,878 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP