Last active
August 29, 2015 13:57
-
-
Save matula/9788454 to your computer and use it in GitHub Desktop.
Helper function to var_dump either Eloquent models or a regular object/array
This file contains hidden or 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
<?php | |
function sd($obj) { | |
if ($obj instanceof Illuminate\Database\Eloquent\Collection) { | |
var_dump(json_decode((string)$obj, true)); | |
} else { | |
var_dump((array)$obj); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment