title: Delete a value from a Laravel 5.4 database
body: <p>I'm trying to delete values from my database in Laravel 5.4. Here is my code:</p>
  
  <p><strong>UserController.php:</strong></p>
  
  <pre><code>public function destroy($id)
  {
  
   $user = User::find($id);
   $user-&gt;delete();
   return redirect()-&gt;route('user.index');
  }
  </code></pre>
  
  <p><strong>View.blade.php</strong></p>
  
  <pre><code>&lt;div class="table-responsive"&gt;
      &lt;table id="datatable-account"
             class="table table-vcenter table-hover table-condensed table-bordered text-center"&gt;
          &lt;thead&gt;
          &lt;tr&gt;
              &lt;th class="text-center"&gt;Username&lt;/th&gt;
              &lt;th class="text-center"&gt;Last Name&lt;/th&gt;
              &lt;th class="text-center"&gt;First Name&lt;/th&gt;
              &lt;th class="text-center"&gt;Role&lt;/th&gt;
              &lt;th class="text-center"&gt;Email&lt;/th&gt;
              &lt;th class="text-center"&gt;Action&lt;/th&gt;
          &lt;/tr&gt;
          &lt;/thead&gt;
      &lt;/table&gt;
  
  &lt;/div&gt;
  
  &lt;script type="text/javascript"&gt;
  
  $('#datatable-account').DataTable({
      processing: true,
      serverSide: true,
      "ajax": '{!! url('api/user') !!}',
      "columns": [
          {data: 'username', name: 'username'},
          {data: 'lastname', name: 'lastname'},
          {data: 'firstname', name: 'firstname'},
          {data: 'role', name: 'role',
              render: function (data, types, full, meta) {
                  if (data == 0){ return 'Admin' } else return 'User';}
          },
          {data: 'email', name: 'email'},
          {data: 'id', name: "id",
              render: function (data, types, full, meta) {
                  return '&lt;a href="{{ url('delete')}}" data-method="delete" button type="button" class="btn btn-danger btn-xs delete-user" name="delete"&gt;&lt;i class="fa fa-times"&gt;&lt;/i&gt; Delete&lt;/button&gt;&lt;/a&gt;';
              }
          }
      ]
  });
  </code></pre>
  
  <p></p>
  
  <p><strong>Routes.php</strong> </p>
  
  <pre><code>Route::post('/delete', ['as' =&gt; 'delete', 'uses' =&gt; 'UserController@destroy']);
  </code></pre>
  
  <p>When I click the button Delete, not an error appears, but the value from the Database is still there. What I'm missing. Thanks in advance.</p>