In fact i'm looking for way to fetch url segment and replace it to another string name for example /setting show it in my view الضبط in Arabic
After research i found substr_replace or str_ireplacecan achieve that
as the following:
$seg2 = request()->segment(2);
($seg2 == 'setting') ? $seg2 = str_ireplace($seg2,'الضبط',$seg2) : $seg2 = str_ireplace($seg2,'another_segment_name', $seg2);
I see this approach is very bad if i have many of different routes can to be in $seg2 place .
If there any other way can achieve that please help me ,Thanks