tightenco/ziggy
Ziggy brings Laravel’s named routes to JavaScript with a route() helper that mirrors Laravel’s. Generate URLs client-side with parameters, model binding, and TypeScript support, and filter which routes are exposed. Works with Vue, React, SPAs, and separate repos.
Fixed
Changed
Added
[@routes](https://github.com/routes) for improved CSP compatibility by @flexponsive in https://github.com/tighten/ziggy/pull/831Fixed
# in URL by @bakerkretzmar in https://github.com/tighten/ziggy/pull/863Changed
qs by @benmccann in https://github.com/tighten/ziggy/pull/846Fixed
Changed
Types.php by @rrmesquita in https://github.com/tighten/ziggy/pull/821Fixed
current() type in strict mode by @bakerkretzmar in https://github.com/tighten/ziggy/pull/809Added
Fixed
ParsedQs type by @bakerkretzmar in https://github.com/tighten/ziggy/pull/806Fixed
Fixed
qs type dependenciesAdded
Fixed
queryParams return type by @bakerkretzmar in https://github.com/tighten/ziggy/pull/788Changed
README.md. by @choowx in https://github.com/tighten/ziggy/pull/782Fixed
Changed
Added
Changed
Fixed
Added
Fixed
Added
Fixed
Fixed
Fixed
Fixed
Fixed
Fixed
See UPGRADING for detailed upgrade instructions.
Changed
Tightenco\Ziggy to Tighten\Ziggy.Removed
makeDirectory method of CommandRouteGenerator class private.check() method.Added
Fixed
route().current() with encoded characters by @bakerkretzmar in https://github.com/tighten/ziggy/pull/668route().current() with nested/object query params by @bakerkretzmar in https://github.com/tighten/ziggy/pull/712Changed
Fixed
route().current() with encoded characters by @bakerkretzmar in https://github.com/tighten/ziggy/pull/668Changed
Added
ziggy.d.ts generation by @lmeysel and @bakerkretzmar in https://github.com/tighten/ziggy/pull/664Added
useRoute() React hook by @bakerkretzmar in https://github.com/tighten/ziggy/pull/473Fixed
absolute: false by @bakerkretzmar in https://github.com/tighten/ziggy/pull/667Fixed
Fixed
Added
'ziggy.output.path' config option by @mhelaiwa https://github.com/tighten/ziggy/pull/633Added
Fixed
route().params not being decoded by @Tofandel in https://github.com/tighten/ziggy/pull/610Fixed
getKeyName() and $primaryKey by @Jared0430 in https://github.com/tighten/ziggy/pull/630Added
! by @bakerkretzmar in https://github.com/tighten/ziggy/pull/559Changed
Fixed
null as entire params argument by @bakerkretzmar in https://github.com/tighten/ziggy/pull/582Fixed
replaceAll for better browser support by @bakerkretzmar in https://github.com/tighten/ziggy/pulls/548Fixed
route().current() with 'wheres' that include regex start/end anchors by @bakerkretzmar in https://github.com/tighten/ziggy/pull/535Added
provide/inject support to the Vue plugin by @c-fitzmaurice in https://github.com/tighten/ziggy/pull/518Fixed
Added
Fixed
Fixed
route().current() matching route names with multiple periods (#466)Added
Fixed
Fixed
Fixed
Fixed
Fixed
Changed
Object.assign() to merge routes (#429)Added
location configurable (adds better support for SSR) (#432)Added
Fixed
route().current() on routes at the domain root (#356)Added
check() method (#294) and how to install and use Ziggy via npm and over a CDN (#299)/users/{user}/posts/{post:slug} (#307)current() to check against the current URL in addition to the route name (#330)Changed
ziggy:generate output path for Laravel 5.7+ resources directory structure, thanks [@Somethingideally](https://github.com/Somethingideally)! (#269)id parameter detection to check for higher priority named route parameters and allow passing id as a query parameter (#301)RoutePayload class to Ziggy and remove its compile method in favour of constructing a new instance and calling ->toArray() or ->toJson() (#305)
new Ziggy(...) now takes only 2 arguments, $group and $urlbasePort from false to nullgetRoutePayload() methods on the BladeRouteGenerator and CommandRouteGenerator classeswhitelist and blacklist functionality to only and except (#300)baseUrl to the value of the APP_URL environment variable instead of url('/') (#334)route() function when any arguments are passed to it (#336)namedRoutes → routes, defaultParameters → defaults, baseUrl → url, and basePort → port (#338)filter() method on the Ziggy class return an instance of that class instead of a collection of routes (#341)nameKeyedRoutes(), resolveBindings(), applyFilters(), and group() methods on the Ziggy class, and the generate() method on the CommandRouteGenerator class, private (#341)index.js instead of route.js (#344).current() respects the value of the absolute option (#353)Deprecated
with() and check() methods (#330)Removed
Route Facade macros Route::only() and Route::except() (previously Route::whitelist() and Route::blacklist()) (#306)Router class returned by the route() function (#330):
name, absolute, ziggy, urlBuilder, template, urlParams, queryParams, and hydratednormalizeParams(), hydrateUrl(), matchUrl(), constructQuery(), extractParams(), parse(), and trimParam()UrlBuilder class (#330)url() method now that route(...) returns a string (#336)baseDomain and baseProtocol properties on the Ziggy config object (#337)appendRouteToList(), isListedAs(), except(), and only() methods from the Ziggy class (#341)Fixed
id parameter detection by also excluding routes with an optional id parameter ({id?}), thanks [@Livijn](https://github.com/Livijn)! (#263)current() when the current URL has a query string (#330)Fixed
. characters in the current() method, thanks [@davejamesmiller](https://github.com/davejamesmiller)! (#296)Added
nonce attribute to the [@routes](https://github.com/routes) Blade directive to be set on the script tag, thanks [@tminich](https://github.com/tminich)! (#287)Changed
dist/js/route.js as the npm package's main target, thanks [@ankurk91](https://github.com/ankurk91) and [@benallfree](https://github.com/benallfree)! (#276)Fixed
For previous changes see the Releases page.
How can I help you explore Laravel packages today?