QueryExecutedListener.php 358 B

123456789101112131415
  1. <?php
  2. namespace App\Listeners;
  3. use Illuminate\Database\Events\QueryExecuted;
  4. class QueryExecutedListener
  5. {
  6. public function handle(QueryExecuted $event)
  7. {
  8. // If triggered, will be shown in addition to the controller response.
  9. // Don't use dd() as it includes a die() so the results are not stored.
  10. echo $event->sql;
  11. }
  12. }