Skip to content

Commit 502b489

Browse files
[11.x] Add Dumpable trait to Uri (#53960)
* add dumpable trait to Uri * dump/dd only the string representation of the URI * Update Uri.php --------- Co-authored-by: Taylor Otwell <[email protected]>
1 parent 1f73ec9 commit 502b489

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

src/Illuminate/Support/Uri.php

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
use Illuminate\Contracts\Support\Responsable;
99
use Illuminate\Http\RedirectResponse;
1010
use Illuminate\Support\Traits\Conditionable;
11+
use Illuminate\Support\Traits\Dumpable;
1112
use Illuminate\Support\Traits\Tappable;
1213
use League\Uri\Contracts\UriInterface;
1314
use League\Uri\Uri as LeagueUri;
@@ -16,7 +17,7 @@
1617

1718
class Uri implements Htmlable, Responsable, Stringable
1819
{
19-
use Conditionable, Tappable;
20+
use Conditionable, Dumpable, Tappable;
2021

2122
/**
2223
* The URI instance.
@@ -351,6 +352,19 @@ public function isEmpty(): bool
351352
return trim($this->value()) === '';
352353
}
353354

355+
/**
356+
* Dump the string representation of the URI.
357+
*
358+
* @param mixed ...$args
359+
* @return $this
360+
*/
361+
public function dump(...$args)
362+
{
363+
dump($this->value(), ...$args);
364+
365+
return $this;
366+
}
367+
354368
/**
355369
* Set the URL generator resolver.
356370
*/

0 commit comments

Comments
 (0)