Files
einundzwanzig-app/app/helpers.php
2025-11-21 04:28:08 +01:00

14 lines
403 B
PHP

<?php
if (!function_exists('route_with_country')) {
function route_with_country(string $name, array $parameters = [], bool $absolute = true): string
{
if (!isset($parameters['country'])) {
$country = request()->route('country') ?? 'de';
$parameters = ['country' => $country] + $parameters;
}
return route($name, $parameters, $absolute);
}
}