title: Delete data from the database with Laravel 5.4
body: <p>I am sort of new to the Laravel framework and I am building just a simple blog. I can create a blog, show a blog and show a overview of all blogs. Now I would like to delete a blog. So, I have created a delete button in my view with a route link which will pass also the id of the article. Then, in my routes file I specify a delete request and a controller method. In the method I find the id and try to delete the row with the id I specified in the route/view.</p>
  
  <p>This doesn't work. Instead of activate the destroy/delete method it shows the article instead of deleting it and activates the show method instead of the delete method. Can somebody help me out, What do I wrong?</p>
  
  <p><strong>View.blade.php</strong></p>
  
  <pre><code>&lt;a href="{{route('nieuws.destroy', ['id' =&gt; $blog-&gt;id])}}" onclick="return confirm('Weet je dit zeker?')"&gt;
    &lt;i class="fa fa-trash"&gt;&lt;/i&gt;
  &lt;/a&gt;
  </code></pre>
  
  <p><strong>Route</strong></p>
  
  <pre><code>Route::group(['middleware' =&gt; 'auth'], function () {
  
      Route::get('/aanvragen', 'aanvragenController@index')-&gt;name('aanvragen.index');
  
      Route::get('/logout' , 'Auth\LoginController@logout')-&gt;name('logout');
  
      Route::get('/nieuws/toevoegen', 'blogController@create')-&gt;name('blogs.add');
  
      Route::post('/nieuws/store', 'blogController@store')-&gt;name('nieuws.store');
  
      Route::delete('/nieuws/{id}', 'blogController@destroy')-&gt;name('nieuws.destroy');
  
  });
  
  Route::get('/nieuws', 'blogController@index')-&gt;name('blogs.index');
  
  Route::get('/nieuws/{blog}', 'blogController@show')-&gt;name('blogs.show');
  </code></pre>
  
  <p><strong>Controller methods</strong></p>
  
  <p>Delete/Destroy</p>
  
  <pre><code>public function destroy($id) {
  
      $blog = Blog::find($id);
  
      $blog-&gt;delete();
  
      return redirect('/nieuws');
  
  }
  </code></pre>
  
  <p>Show</p>
  
  <pre><code>public function show(Blog $blog) {
  
      dd('show');
  
  
      return view('blogs.show', compact('blog'));
  
  }
  </code></pre>