Created
September 2, 2019 04:55
-
-
Save fontenele/7625cb71c0a8356213abc727278b48d5 to your computer and use it in GitHub Desktop.
Laravel Debug Helper fixed in Chrome DevTools
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"autoload": { | |
"files": [ | |
"helpers.php" | |
] | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Use
_dd($args)