title: Laravel 5: when protecting delete route after authentication MethodNotAllowedHttpException in RouteCollection.php
body: <p>hoping that someone can help out.</p>
  
  <p>I have all other methods (edit and new) working well with protected routes at this stage. It's just delete that is not playing nice. (although I'm sure it's something silly that I am doing). I have removed the auth by taking the delete out of the route group with the middleware assigned to it and it successfully deletes the config (object) so the action is working correctly. I try to check it in firebug as suggested in another post and I get:</p>
  
  <pre><code>405 Method Not Allowed
  
  Allow           DELETE
  Cache-Control   no-cache, private
  Connection      close
  Content-Type    text/html
  Date            Wed, 11 Nov 2015 12:36:40 GMT
  Host            127.0.0.1:8000
  X-Powered-By    PHP/5.5.9-1ubuntu4.14
  </code></pre>
  
  <p>I would like to have the user authenticate before creating a new entry or editing an existing one (and likewise for delete).</p>
  
  <p>When I try a delete by pressing the button, and it directs me to auth/login (out of the box quickstart auth for laravel) as it should, but then upon successful login, the url in the address bar is:</p>
  
  <p><code>127.0.0.1:8000/delete/48</code></p>
  
  <p>showing:</p>
  
  <p><code>MethodNotAllowedHttpException in RouteCollection.php line 219:</code></p>
  
  <p><code>routes.php:</code></p>
  
  <pre><code>Route::get('/new', [
      'as' =&gt; 'create', 
      'middleware' =&gt; 'auth',
      'uses' =&gt; 'ConfigsController@getCreate'
  ]);
  $router-&gt;group(['middleware' =&gt; 'auth'], function($router)
      {
      Route::get('{id}/edit', 'ConfigsController@edit');
      Route::delete('/delete/{id}/', 'ConfigsController@getDL');
      });
  
  +--------+----------+-------------------+----------+-------------------------------------------------------+------------+
  | Domain | Method   | URI               | Name     | Action                                                | Middleware |
  +--------+----------+-------------------+----------+-------------------------------------------------------+------------+
  |        | DELETE   | delete/{id}       |          | App\Http\Controllers\ConfigsController@getDL          | auth       |
  |        | POST     | new               |          | App\Http\Controllers\ConfigsController@postCreate     |            |
  |        | GET|HEAD | new               | create   | App\Http\Controllers\ConfigsController@getCreate      | auth       |
  |        | GET|HEAD | {id}/edit         |          | App\Http\Controllers\ConfigsController@edit           | auth       |
  </code></pre>
  
  <p><code>ConfigsController.php:</code></p>
  
  <pre><code>public function getCreate() {
  return view('create');
  }
  
  public function edit($id)
  {
  $configs = Config::find($id);
      return view('edit')
      -&gt;with('configs', $configs);
  }
  
  public function getDL($id) {
      $configs = Config::find($id)-&gt;delete();
      return Redirect::to('/');
  }
  </code></pre>
  
  <p><code>index.blade.php (edit &amp; delete) &amp; app.blade.php (new):</code></p>
  
  <pre><code>&lt;ul class="nav navbar-nav"&gt;
    &lt;li&gt;&lt;a href="{{ URL::route('create') }}"&gt;New&lt;/a&gt;&lt;/li&gt;
  &lt;/ul&gt;
  
  {!! Form::open(array('url' =&gt; '/delete/' . $config-&gt;id . '/', 'class' =&gt; 'pull-right')) !!}
  {!! Form::hidden('_method', 'DELETE') !!}
  {!! Form::submit('Delete this Config', array('class' =&gt; 'btn btn-warning')) !!}
  {!! Form::close() !!}
  
  &lt;a class="btn btn-small btn-info" href="{{ URL::to('/' . $config-&gt;id . '/edit') }}"&gt;Edit this Config&lt;/a&gt;
  </code></pre>