spatie/backtrace
Spatie Backtrace makes PHP backtraces easier than debug_backtrace(): frames are aligned correctly and exposed as Frame objects with file, line, class, method, and optional arguments. Simple API to capture, inspect, and work with stack traces.
spatie/backtrace provides a cleaner, more reliable alternative to PHP’s debug_backtrace(). It fixes confusing frame naming, avoids bitmask options, and returns an easy-to-use collection of Frame objects for inspecting call stacks.
Use Backtrace::create()->frames() to access file, line, class/method, and (optionally) arguments—ideal for debugging, logging, and error reporting.
Spatie\Backtrace\Frame instancesHow can I help you explore Laravel packages today?