Last active
April 3, 2018 07:27
-
-
Save TommyZG/0505eb331f240a6324b0527bc588769c to your computer and use it in GitHub Desktop.
Laravel - dump all passed variables to array for easier read - alias for dd($x->toArray())
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
//add this to /vendor/laravel/framework/src/Illuminate/Support/helpers.php | |
if (! function_exists('da')) { | |
/** | |
* Dump the passed variables to array and end the script. | |
* | |
* @param mixed | |
* @return void | |
*/ | |
function da() | |
{ | |
array_map(function ($x) { | |
dd($x->toArray()); | |
}, func_get_args()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment