Skip to content

Instantly share code, notes, and snippets.

@TommyZG
Last active April 3, 2018 07:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TommyZG/0505eb331f240a6324b0527bc588769c to your computer and use it in GitHub Desktop.
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())
//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