Skip to content

Commit

Permalink
Use named variable to simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
murrant committed Jun 14, 2024
1 parent 4029277 commit dbc1475
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions app/Http/Controllers/Device/Tabs/PortsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -364,9 +364,6 @@ private function parseTab(Request $request): string
};
}

$segments = $request->segments();
$tab_index = array_search('device', $segments) + 3;

return empty($segments[$tab_index]) ? 'detail' : $segments[$tab_index];
return $request->route('vars', 'detail'); // fourth segment is called vars to handle legacy urls
}
}

0 comments on commit dbc1475

Please sign in to comment.