Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>ziggy-route-navigatorNew to Visual Studio Code? Get it now.
ziggy-route-navigator

ziggy-route-navigator

alex-j-b

| (0) | Free
Ctrl/Cmd+Click Ziggy route('...') in JS/TS/React/Vue to jump to Laravel controller.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Ziggy Route Navigator

Jump from Ziggy route('...') calls in JS/TS/React/Vue straight to your Laravel route definition.

Features

  • Go to Definition from route('name') to the ->name('name') in your routes/**/*.php files
  • Watches storage/routes.json and reloads automatically
  • Command: “Ziggy: Update Routes” to regenerate storage/routes.json
  • Works in JavaScript, TypeScript, React (JS/TS), and Vue files

Requirements

  • Open your Laravel project root as the workspace
  • Generate routes once (and whenever they change):
    php artisan route:list --json > storage/routes.json
    

The file should be a JSON array of routes. Route entries with name are recognized. Controller info is optional; navigation targets the route registration itself.

Usage

  1. In your JS/TS/React/Vue file, place the caret on route('your.route')
  2. Ctrl+Click (Windows/Linux) or Cmd+Click (macOS) to jump to the route definition
  3. To refresh routes: run “Ziggy: Update Routes” from the Command Palette

Command

  • ziggy.updateRoutes — regenerates storage/routes.json and reloads

Settings

  • ziggyRouteNavigator.searchGlobs (array, default: ["routes/**/*.php"])
    • Where to search for route registrations (files containing ->name('...')). Paths are globs relative to the workspace root.
  • ziggyRouteNavigator.searchExclude (array, default: ["**/vendor/**"])
    • Globs to exclude from the search.

Example (settings.json):

{
  "ziggyRouteNavigator.searchGlobs": [
    "routes/**/*.php",
    "modules/**/routes/**/*.php"
  ],
  "ziggyRouteNavigator.searchExclude": ["**/vendor/**", "**/node_modules/**"]
}

Notes and Limitations

  • Requires named routes (->name('...')) in your routes files
  • Grouped name prefixes are not resolved; the extension looks for a final ->name('full.name') occurrence
  • Multi-line route chains are supported per line; if your ->name('...') is on another line, you may need to reformat or open a request to improve detection

Behavior details

  • Go to Definition always navigates to the route registration in your routes files (not to controllers). This matches how front-end usage maps to named routes.

Troubleshooting

  • No underline on route('...'):
    • Make sure the file language is JavaScript/TypeScript/React/Vue.
    • Ensure the first argument is a string literal (no variables/template strings).
    • Confirm your workspace root is the Laravel project containing storage/routes.json and routes/.
  • “Loaded 0 routes” in logs:
    • Regenerate: php artisan route:list --json > storage/routes.json
    • Check the JSON is a top-level array and contains name fields.

License

MIT

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft