protected function removeIndex($root) { $i = 'index.php'; return Str::contains($root, $i) ? str_replace('/' . $i, '', $root) : $root; }