@php $path = explode('/', request()->path()); $path[1] = (array_key_exists(1, $path)> 0)?$path[1]:''; $path[2] = (array_key_exists(2, $path)> 0)?$path[2]:''; $path[0] = ($path[0] === '')?'documents':$path[0]; $comp_id = $path[1]; $cust_id = $path[2]; @endphp