Skip to content

Commit a7ce19b

Browse files
committed
Refactor trailing generator
1 parent 05a717b commit a7ce19b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Routing/TrailingSlashUrlGenerator.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ class TrailingSlashUrlGenerator extends UrlGenerator
1717
*/
1818
public function format($root, $path, $route = '')
1919
{
20-
return parent::format($root, $path, $route) . (config('laravel-trailing-slash.active') ? '/' : '');
20+
if (! config('laravel-trailing-slash.active', false)) {
21+
return parent::format($root, $path, $route);
22+
}
23+
24+
return parent::format($root, $path, $route) . '/';
2125
}
2226
}

0 commit comments

Comments
 (0)