laravel-localization
laravel-localization copied to clipboard
error when using optional params in route file
Hi,
I'm having troubles with the package when using optional parameters in my translated routes.
I use {{LaravelLocalization::localizeURL('partners')}} in my view.
I have a route file NL which contains "partners" => "partners/{confirmed?}". I have a route file FR which contains "partners" => "partenaires/{confirmed?}". The result of localizeURL always returns the default url => dev.localhost/fr/partners. If i delete the optional params or i make them required everything works perfectly. I'm using the lastest version of the package and L5.2.
Any ideas?
thx
Have you tried passing null
or empty values as optional parameter? Can't find where I used it but I recall doing it.
Hope it helps.
@afontcu Yes, i also tried {{LaravelLocalization::getLocalizedURL(null,'partners',array('confirmed'=>1)}}. This gives the same result => dev.localhost/fr/partners, no translation took place.
Same problem like @nickbr5. I'm using the latest version of the Laravel 5.3.