dd()in Laravel projects. Improves the default dump behavior for many core Laravel objects, including:
dd()as you would normally, and enjoy the newly curated output! If, for some reason, you really need the full debug output for an object that
laravel-dumpercustomizes, you can do a "full" dump with
dd()output and the
laravel-dumperoutput in the diffs directory of this repository.
dd()behavior for, you can register custom casters using the
reordermethod accepts an array of patterns. For example, the default
Modelcaster uses the following ordering rules:
idis always first, followed by all foreign keys, followed by all other attributes, and then finally followed by timestamp attributes (with
deleted_atlast). By applying bespoke ordering rules, you can make sure that the properties you usually need to debug are at the top of the
laravel-dumperconfig file and registering your custom classes in the
'casters'section of the config. This gives you the same level of control over the
dd()output as the core Symfony VarDumper package, but is more complex to implement.
Glhd\LaravelDumper\Casters\Casterand implement the
castmethod. See any of our built-in casters for more details.