What is the Dumpable trait?
Illuminate\Support\Traits\Dumpable is a small trait that adds dump() and dd() to any class. It was introduced in Laravel 10 and is widely used to provide a consistent debugging experience across core APIs such as Collection, Eloquent Builder, and Request.
The goal is simple: inspect an object quickly, and optionally stop execution at that exact point.
Check the implementation
The implementation is minimal. It only forwards todump($this, ...$args) and dd($this, ...$args).
In Laravel 13, the source lives in
src/Illuminate/Support/Traits/Dumpable.php. The runtime implementation expresses return behavior via PHPDoc (@return $this and @return never).Add it to your own class
Adduse Dumpable; and your class gets dump() / dd() as instance methods.
Debug in the middle of a fluent chain
dump() returns static (implemented as $this), so you can insert it safely in method chains.
dd(), execution stops at that exact point, which is useful before expensive or side-effect-heavy steps.
Using it in package development
AddingDumpable to your own Value Objects, DTOs, and Builder classes gives package users a built-in way to inspect internal state.
Passing extra arguments
BecauseDumpable calls dump($this, ...$args) and dd($this, ...$args), you can pass contextual labels together with the object.
Related traits
tap() helper / Tappable
Learn how to insert side effects while returning the original value.
The Conditionable trait
Learn conditional branching in fluent chains.
The Macroable trait
Learn how to extend existing classes with custom methods.