Skip to content

Instantly share code, notes, and snippets.

@fontenele
Created September 2, 2019 04:55
Show Gist options
  • Save fontenele/7625cb71c0a8356213abc727278b48d5 to your computer and use it in GitHub Desktop.
Save fontenele/7625cb71c0a8356213abc727278b48d5 to your computer and use it in GitHub Desktop.
Laravel Debug Helper fixed in Chrome DevTools
"autoload": {
"files": [
"helpers.php"
]
},
use Illuminate\Support\Debug\Dumper;
if (!function_exists('_dd')) {
function _dd(...$args)
{
$content = '<span>';
ob_start();
foreach ($args as $x) {
(new Dumper)->dump($x);
}
$content .= ob_get_contents();
ob_end_clean();
$content.= '</span>';
$content = str_replace(['<div', '</div>'], ['<span', '</span>'], $content);
response()->make($content, 500, ['Content-Type' => 'text/html'])->send();
die(1);
}
}
@fontenele
Copy link
Author

fontenele commented Sep 2, 2019

Use _dd($args)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment