예제 #1
0
 /**
  * Attach the Profiler's event listeners.
  *
  * @return void
  */
 public static function attach()
 {
     \Laravel\Profiling\Profiler::attach();
     Event::listen('laravel.mongoquery', function ($db, $sql, $bindings, $time) {
         MongoProfiler::mongo_query($db, $sql, $bindings, $time);
     });
 }
예제 #2
0
 /**
  * Attach the Profiler's event listeners.
  *
  * @return void
  */
 public static function attach()
 {
     // First we'll attach to the query and log events. These allow us to catch
     // all of the SQL queries and log messages that come through Laravel,
     // and we will pass them onto the Profiler for simple storage.
     Event::listen('laravel.log', function ($type, $message) {
         Profiler::log($type, $message);
     });
     Event::listen('laravel.query', function ($sql, $bindings, $time) {
         Profiler::query($sql, $bindings, $time);
     });
     // We'll attach the profiler to the "done" event so that we can easily
     // attach the profiler output to the end of the output sent to the
     // browser. This will display the profiler's nice toolbar.
     Event::listen('laravel.done', function ($response) {
         echo Profiler::render($response);
     });
 }