Laravel-Tongue
Laravel-Tongue copied to clipboard
Getting erorr when using Route::view & dialect()->current('www')
Getting erorr when using
// routes/web.php
Route::view('/privacy', 'privacy')->name('privacy');
// some blade
@if(tongue()->current() == 'en')
<a href="{{ dialect()->current('www') }}">
@lang('text.lang_switch')
</a>
@endif
the error is TypeError
vendor\pmochine\laravel-tongue\src\Accent\Accent.php : 81
TypeError
str_replace(): Argument #2 ($replace) must be of type string when argument #1 ($search) is a string
public static function substituteAttributesInRoute($attributes, $route)
{
foreach ($attributes as $key => $value) {
$route = str_replace('{'.$key.'}', $value, $route); // error happens here
$route = str_replace('{'.$key.'?}', $value, $route);
}
Thanks