title: Delete row from database table with Laravel 5.2
body: <p>Recently I've started with Laravel 5.2 and I'm trying to make delete button which will delete row from database. Very basic and trivial but seems I can't make it. </p>
  
  <p>I'm following documentation for delete: <a href="https://laravel.com/docs/5.2/queries#deletes" rel="nofollow noreferrer">https://laravel.com/docs/5.2/queries#deletes</a></p>
  
  <p>And I have made this. My route:</p>
  
  <pre><code>Route::post('flags/destroy/{delete}', 'FlagsController@destroy')-&gt;name('admin.flags.destroy');
  </code></pre>
  
  <p>Button in the view</p>
  
  <pre><code>{!! Html::linkRoute('admin.flags.destroy', 'Delete', $flag-&gt;report_id) !!}
  </code></pre>
  
  <p>and the controller</p>
  
  <pre><code>public function destroy(Request $request){
  
      $report = $request['report_id'];      
  
      Report::find($report);
  
      $report-&gt;delete();        
      $request-&gt;session()-&gt;flash('alert-success', ' Report is deleted successfully.');
  
      return redirect()-&gt;route('admin.flags');
  }
  </code></pre>
  
  <p>I've tried solutions from other threads but I always got error:</p>
  
  <blockquote>
    <p>MethodNotAllowedHttpException in compiled.php line 8936:</p>
  </blockquote>
  
  <p>New error: </p>
  
  <pre><code>SQLSTATE[42S22]: Column not found: 1054 Unknown column 'reports.id' in 'where clause' (SQL: select * from `reports` where `reports`.`id` is null limit 1
  </code></pre>
  
  <p>Why is searching for <code>id</code> instead of <code>report_id</code>?</p>
  
  <p>UPDATE:</p>
  
  <p>button</p>
  
  <pre><code>{!! Html::linkRoute('admin.flags.destroy', 'Delete', $flag-&gt;report_id) !!}
  </code></pre>
  
  <p>Controller</p>
  
  <pre><code>public function destroy(Request $request){
  
      $report = $request['report_id'];      
  
      dd( $request-&gt;input('delete'));
  
      Report::where('report_id', $report)-&gt;first();
  
      $report-&gt;delete();        
      $request-&gt;session()-&gt;flash('alert-success', ' Report is deleted successfully.');
  
      return redirect()-&gt;route('admin.flags');
  }
  </code></pre>
  
  <p>Route</p>
  
  <pre><code>Route::get('flags/destroy/{delete}', 'FlagsController@destroy')-&gt;name('admin.flags.destroy');
  </code></pre>
  
  <p>Update 2: This seems to work but is it secure enough?
  view:</p>
  
  <pre><code> {!! Form::open(array('route' =&gt; array('admin.flags.destroy', $flag-&gt;report_id), 'method' =&gt; 'get')) !!}
          &lt;button type="submit"&gt;Delete&lt;/button&gt;
   {!! Form::close() !!}&lt;/td&gt; 
  </code></pre>
  
  <p>Controller</p>
  
  <pre><code>public function destroy($report_id){
  
    Report::destroy($report_id);
    //$request-&gt;session()-&gt;flash('alert-success', ' Report is deleted successfully.');
  
    return redirect()-&gt;route('admin.flags');
  }
  </code></pre>