Skip to content

Commit 32cde6a

Browse files
committed
Catch InvalidArgumentException from route() call
1 parent c253855 commit 32cde6a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/LocalizedUrlGenerator.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
use Illuminate\Support\Facades\Config;
99
use Illuminate\Support\Facades\Request;
1010
use Illuminate\Support\Facades\Route;
11+
use InvalidArgumentException;
1112
use Symfony\Component\Routing\Exception\RouteNotFoundException;
1213

1314
class LocalizedUrlGenerator
@@ -96,6 +97,8 @@ protected function generateFromNamedRoute($locale, $parameters, $absolute)
9697
return route($name, $parameters, $absolute, $locale);
9798
} catch (RouteNotFoundException $e) {
9899
return '';
100+
} catch (InvalidArgumentException $e) {
101+
return '';
99102
}
100103
}
101104

0 commit comments

Comments
 (0)