title: laravel cancel database query
body: <p>I have a site in laravel where a single page makes multiple database queries (select statements which can take a little while to run).</p>
  
  <p>Is there a way to detect if a user:</p>
  
  <ul>
  <li>Refreshes the page</li>
  <li>Changes the parameters of the query</li>
  <li>Closes the page</li>
  </ul>
  
  <p>hence meaning that the result of the query is not needed, and therefore cancelling it or killing the process?</p>
  
  <p>Note the database is mysql so I can from mysql workbench easily call <code>kill {PID}</code> to end a similar query manually.</p>
  
  <p>Thanks!</p>