@php $current_url = url()->current(); $getPath = str_replace(url('/'),'',$current_url); $getPath = explode('/',$getPath); $getPath = isset($getPath[2]) ? $getPath[2]:$getPath[1]; $getPath = \Str::replaceFirst('/','',$getPath); $getPath = str_replace('/',' ',$getPath); $getPath = str_replace('_',' ',$getPath); $getPath = str_replace('-',' ',$getPath); $path = \Str::title($getPath); @endphp