array(), 'logs' => array()); /** * Get the rendered contents of the Profiler. * * @param Response $response * @return string */ public static function render($response) { // We only want to send the profiler toolbar if the request is not an AJAX // request, as sending it on AJAX requests could mess up JSON driven API // type applications, so we will not send anything in those scenarios. if ( ! Request::ajax()) { return render('path: '.__DIR__.'/template'.BLADE_EXT, static::$data); } } /** * Add a log entry to the log entries array. * * @return void */ public static function log($type, $message) { static::$data['logs'][] = array($type, $message); } /** * Add a performed SQL query to the Profiler. * * @param string $sql * @param array $bindings * @param float $time * @return void */ public static function query($sql, $bindings, $time) { foreach ($bindings as $binding) { $sql = preg_replace('/\?/', $binding, $sql, 1); } static::$data['queries'][] = array($sql, $time); } /** * Determine if the given response includes jQuery. * * @param Response $response * @return bool */ protected static function has_jquery($response) { $pattern = '/\
(.*)\