Skip to content

Commit 12a9bae

Browse files
Use Str class instead of helper function
1 parent 7684632 commit 12a9bae

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/MissingPageRouter.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use Exception;
66
use Illuminate\Routing\Router;
7+
use Illuminate\Support\Str;
78
use Spatie\MissingPageRedirector\Events\RedirectNotFound;
89
use Spatie\MissingPageRedirector\Events\RouteWasHit;
910
use Spatie\MissingPageRedirector\Redirector\Redirector;
@@ -34,8 +35,8 @@ public function getRedirectFor(Request $request)
3435
$redirects = $this->redirector->getRedirectsFor($request);
3536

3637
collect($redirects)->each(function ($redirects, $missingUrl) {
37-
if (str($missingUrl)->contains('*')) {
38-
$missingUrl = str($missingUrl)->replace('*', '{wildcard}');
38+
if (Str::of($missingUrl)->contains('*')) {
39+
$missingUrl = Str::replace('*', '{wildcard}', $missingUrl);
3940
}
4041

4142
$this->router->get($missingUrl, function () use ($redirects, $missingUrl) {

0 commit comments

Comments
 (0)