title: Can't post to route '/'
body: <p>Running Laravel 5.4 (though also happens with 7.28), I have a login page at route '/' so a GET request to that route loads the login form and a POST request should attempt to authenticate it. Unfortunately Laravel seems to see the POST requests as GET requests (I've confirmed by dump()ing the request variables) and so reloads the blank login page upon form submission.</p>
  <p>If I change the route (URL) to '/login' (or anything else) it works fine, so it's a specific problem for '/'.</p>
  <p>Login form (login.blade.php) has:</p>
  <pre><code>&lt;form id=&quot;loginform&quot; class=&quot;contact form-horizontal&quot; name=&quot;loginform&quot; method=&quot;post&quot; action=&quot;{{url('/')}}&quot;&gt;
  ...
      &lt;button type=&quot;submit&quot; class=&quot;btn btn-lg btn-primary&quot;&gt;Log In&lt;/button&gt;
  &lt;/form&gt;
  </code></pre>
  <p>web.php:</p>
  <pre><code>Route::get('/', 'MainController@login')-&gt;name('login');
  Route::post('/', 'MainController@authenticate');
  </code></pre>
  <p>MainController.php:</p>
  <pre><code>// Show login page
  public function login() { return view('login', array('page' =&gt; 'login', 'error' =&gt; rand())); }
  
  // Authenticate login:
  public function authenticate(Request $request)
          {
          // Attempt a login with the email and password provided:
          if(Auth::attempt(['email' =&gt; $request-&gt;input('email'), 'password' =&gt; $request-&gt;input('password')]))
              {
              Log::info('LOGGED IN');
              return redirect()-&gt;route('main'); // Show main page
              }
          else return view('login', array('page' =&gt; 'login', 'error' =&gt; 'Sorry, wrong email or password, please try again')); // Login failed, show login form again
          }
  </code></pre>
  <p>My overall objective is to have the site present the login page at the domain name, so user doesn't have to add '/login' at the end just to login.</p>
  <p>Thanks</p>
  <p>EDIT: Checking the browser POST reveals the actual problem, Laravel is responding with a 301 redirect from http://localhost/pp/public so the browser immediately does a GET request to http://localhost/pp/public/ (note / on the end). Hmm, how to avoid this?</p>