title: Laravel Redirect on trailing slash [ / ]
body: <p>Laravel is redirecting from an <strong>OPTIONS</strong> method to a <strong>GET</strong> method.</p>
  
  <p>web.php (Route)</p>
  
  <pre><code>Route::any('/files/{document?}','webDavController@dispatch')-&gt;name('webDav');
  </code></pre>
  
  <p>webDavController.php</p>
  
  <pre><code>private $allowMethods = array('options','get','head','post','delete','trace','propfind','proppatch','copy','mkcol','put');
  
  public function dispatch(  $fileId = false  ){
  
  
          $method = strtolower($_SERVER['REQUEST_METHOD']);
  
          if(in_array($method, $this-&gt;allowMethods)){         
              switch ($method){
                  case "get":
                      $this-&gt;getFile();
                      break;
                  case "put":
                      $this-&gt;putFile();
                      break;
                  case "options":
                      $this-&gt;getOptions();
                      break;
              }
  
          }
  
      }
  </code></pre>
  
  <p>Apache access logs</p>
  
  <pre><code>x.x.x.x - - [07/Jan/2020:10:49:37 -0500] "OPTIONS /files/ HTTP/1.1" 301 246 "-" "PostmanRuntime/7.21.0"
  x.x.x.x - - [07/Jan/2020:10:49:37 -0500] "GET /files HTTP/1.1" 200 68280 "https://server.com/files/" "PostmanRuntime/7.21.0"
  
  </code></pre>
  
  <p>Why is this redirect happening ? How can I fix it, why is it rewrite to a <strong>GET</strong>? I did an apache mod-rewrite as suggested by other users but still with the issue, maybe I am not doing it correctly.  </p>