Skip to content

Commit d925372

Browse files
authored
[10.x] Add Carbon dd() and dump() methods (#47002)
* Add dd and dump methods to Carbon * Code style
1 parent 357333a commit d925372

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

src/Illuminate/Support/Carbon.php

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,27 @@ public static function setTestNow($testNow = null)
1818
BaseCarbon::setTestNow($testNow);
1919
BaseCarbonImmutable::setTestNow($testNow);
2020
}
21+
22+
/**
23+
* Dump the instance and end the script.
24+
*
25+
* @param mixed ...$args
26+
* @return never
27+
*/
28+
public function dd(...$args)
29+
{
30+
dd($this, ...$args);
31+
}
32+
33+
/**
34+
* Dump the instance.
35+
*
36+
* @return $this
37+
*/
38+
public function dump()
39+
{
40+
dump($this);
41+
42+
return $this;
43+
}
2144
}

0 commit comments

Comments
 (0)