Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Laravel
  3. Ziggy

Ziggy

MITJavaScriptv2.6.2

A JavaScript library that provides a Laravel-like route() helper for generating URLs from named Laravel routes in JavaScript.

GitHubGitHub
4.3k stars271 forks0 contributors

What is Ziggy?

Ziggy is a JavaScript library that provides a route() helper function matching Laravel's syntax, allowing developers to generate URLs for named Laravel routes directly in JavaScript. It solves the problem of maintaining consistent URLs between Laravel backend routes and JavaScript frontend code, eliminating manual URL construction and reducing errors.

Target Audience

Laravel developers building JavaScript frontends (Vue, React, or vanilla JS) who need to generate URLs that match their Laravel application's named routes.

Value Proposition

Developers choose Ziggy because it provides a seamless, type-safe way to use Laravel routing in JavaScript with full support for route parameters, query strings, route-model binding, and framework integrations, reducing duplication and ensuring URL consistency.

Overview

Use your Laravel routes in JavaScript.

Use Cases

Best For

  • Generating URLs for AJAX requests in Laravel applications
  • Building Vue or React frontends that need to link to Laravel routes
  • Maintaining consistent routing between Laravel backend and JavaScript SPA
  • Implementing route-model binding in JavaScript frontends
  • Adding TypeScript autocompletion for Laravel route names
  • Filtering which Laravel routes are exposed to the frontend for security

Not Ideal For

  • Projects not using Laravel as the backend framework, since Ziggy is tightly coupled to Laravel's routing system
  • Applications relying solely on server-side rendering with minimal JavaScript, where frontend route generation adds unnecessary complexity
  • Teams preferring fully decoupled frontends with independent routing libraries like React Router or Vue Router, without backend dependencies
  • Non-PHP or multi-framework environments where similar route synchronization is needed but Ziggy's Laravel integration cannot be leveraged

Pros & Cons

Pros

Laravel Syntax Parity

Ziggy's route() function exactly mirrors Laravel's helper, supporting parameters, query strings, and default values, as demonstrated in the README's extensive examples.

Route-Model Binding

Automatically respects Laravel's route-model binding keys like 'slug' or custom keys when passing JavaScript objects, eliminating manual parameter extraction.

Framework Integrations

Includes Vue plugin and React hook for seamless use in modern frontends, with clear setup instructions in the README for both frameworks.

TypeScript Autocompletion

Offers full TypeScript definitions and an Artisan command to generate strict route name checking, enhancing developer experience with IDE support.

Configurable Route Filtering

Allows filtering routes via config files or groups, enabling control over which routes are exposed to the frontend for security, as detailed in the Filtering Routes section.

Cons

Laravel-Only Lock-In

Ziggy is useless outside Laravel ecosystems, making it a poor choice for multi-framework projects or those migrating away from Laravel.

Complex SPA Setup

For single-page applications or separate frontend repos, manual configuration is required to generate and import route files, adding steps compared to integrated solutions.

Default Route Exposure

The @routes Blade directive outputs all named routes in HTML by default, risking unintended information leakage if not explicitly filtered, which the README warns about.

Maintenance Overhead

Changes to Laravel routes necessitate regenerating Ziggy's config, and without automated tooling like the provided Mix plugin, this can be a manual, error-prone process.

Frequently Asked Questions

Quick Stats

Stars4,292
Forks271
Contributors0
Open Issues4
Last commit28 days ago
CreatedSince 2017

Tags

#laravel#vue-plugin#typescript#javascript#routes

Built With

R
React
J
JavaScript
T
TypeScript
L
Laravel
V
Vue

Included in

Laravel13.0k
Auto-fetched 1 day ago

Related Projects

LiveWireLiveWire

A full-stack framework for Laravel that takes the pain out of building dynamic UIs.

Stars23,502
Forks1,735
Last commit1 day ago
Debug BarDebug Bar

Debugbar for Laravel (Integrates PHP Debug Bar)

Stars19,179
Forks1,607
Last commit1 day ago
IDE HelperIDE Helper

IDE Helper for Laravel

Stars14,891
Forks1,188
Last commit23 days ago
Intervention ImageIntervention Image

PHP Image Processing

Stars14,330
Forks1,491
Last commit5 days ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub