All notable changes to this project will be documented in this file.
This project adheres to Semantic Versioning, and the format of this changelog is based on Keep a Changelog.
Breaking changes are marked with
v1.8.0 - 2023-10-06
Added
- Add type declarations and
ziggy.d.ts
generation by @lmeysel and @bakerkretzmar in tighten#664
v1.7.0 - 2023-10-04
Added
- Add
useRoute()
React hook by @bakerkretzmar in tighten#473
Fixed
- URL-encode fewer special characters inside in route parameters by @bakerkretzmar in tighten#662
- Fix empty root URL with
absolute: false
by @bakerkretzmar in tighten#667
v1.6.2 - 2023-08-18
Fixed
- Make slash "not encoding" less restrictive by @aguingand in tighten#661
v1.6.1 - 2023-08-04
Fixed
- Fix numeric route names by @bakerkretzmar tighten#658
v1.6.0 - 2023-05-12
Added
- Add
'ziggy.output.path'
config option by @mhelaiwa tighten#633
v1.5.2 - 2023-05-05
Added
- Add Vite instructions to README.md by @fullstackfool tighten#627
Fixed
- Trim slashes between origin and optional first param by @bakerkretzmar in tighten#637
- Fix
route().params
not being decoded by @Tofandel in tighten#610
v1.5.1 - 2023-04-22
Fixed
- Check for overridden
getKeyName()
and$primaryKey
by @Jared0430 in tighten#630
v1.5.0 - 2022-09-23
Added
- Add support for negating route filter patterns with
!
by @bakerkretzmar in tighten#559
Changed
- Test on PHP 8.2 by @bakerkretzmar in tighten#584
Fixed
- Allow
null
as entire params argument by @bakerkretzmar in tighten#582
v1.4.6 - 2022-04-08
Fixed
- Use global regex instead of
replaceAll
for better browser support by @bakerkretzmar in https://github.com/tighten/ziggy/pulls/548
v1.4.5 - 2022-03-25
Fixed
- Remove dead code by @Tofandel in tighten#525
- Fix
route().current()
with 'wheres' that include regex start/end anchors by @bakerkretzmar in tighten#535 - Fix inherited custom route key name detection by @bakerkretzmar in tighten#540
v1.4.4 - 2022-03-11
Added
- Allow custom output via formatters by @jaulz in tighten#483
- Add Vue 3
provide
/inject
support to the Vue plugin by @c-fitzmaurice in tighten#518
Fixed
- Encode non-slash characters in wildcard last parameter by @rodrigopedra in tighten#507
- Update JS route matching to take 'wheres' into account by @Tofandel in tighten#514
v1.4.3 - 2022-01-28
Added
- Test on PHP 8.1 by @bakerkretzmar in tighten#484
- Don't encode slashes in wildcard last parameter by @bakerkretzmar in tighten#500
Fixed
- Ignore route action parameters without URI segments by @jaulz in tighten#482
v1.4.2 - 2021-10-01
Fixed
- Fix
route().current()
matching route names with multiple periods (#466)
v1.4.1 - 2021-09-24
Fixed
- Fix
undefined
error if there's no globalZiggy
variable (#462) - Fix payload caching for Octane (#460)
v1.4.0 - 2021-08-25
Added
- Add support for parameters inside single route segments (#444)
v1.3.6 - 2021-08-25
Fixed
- Fix nested object query params (#451)
v1.3.5 - 2021-07-20
Fixed
- Fix route model binding with abstract class (#445)
v1.3.4 - 2021-07-06
Fixed
- Fix property mangling and implement ES5 compatibility (#442)
v1.3.3 - 2021-07-02
Fixed
- Revert (d781b16)
v1.3.2 - 2021-07-01
Fixed
- Remove Babel preset to correctly transpile to ES5 by default (d781b16)
v1.3.1 - 2021-06-19
Changed
- Use
Object.assign()
to merge routes (#429)
v1.3.0 - 2021-06-17
Added
- Make
location
configurable (adds better support for SSR) (#432)
v1.2.0 - 2021-05-24
Added
v1.1.0 - 2021-04-02
Added
- Prepare for Laravel Octane (#415)
v1.0.5 - 2021-02-05
Added
- Add support for appending 'extra' parameters to the query string (#390)
Changed
- Remove source maps (#395)
Fixed
- Use Laravel's
Reflector
class to get model parameter class name (#396)
v1.0.4 - 2020-12-06
Fixed
- Fix bug where
route().current()
could incorrectly returntrue
on URLs with no parameters (#377) - Fix several other bugs in
route().current()
with params (#379) - Revert #334, default Ziggy's
url
back tourl('/')
instead of theAPP_URL
environment variable (#386)
v1.0.3 - 2020-11-20
Fixed
- Filter out unnamed cached routes with randomly generated names (#370)
- Fix collision with JavaScript built-in method names like
shift
by casting emptydefaults
to an object (#371)
v1.0.2 - 2020-11-13
Fixed
- Make
ziggy:generate
URL behaviour consistent with Ziggy class and Blade directive (#361) - Fix
route().current()
error on unknown/unnamed routes (#362)
v1.0.1 - 2020-11-10
Fixed
- Fix
route().current()
on routes at the domain root (#356)
v1.0.0 - 2020-11-06
Added
- Document the
check()
method (#294) and how to install and use Ziggy vianpm
and over a CDN (#299) - Add support for custom scoped route model binding, e.g.
/users/{user}/posts/{post:slug}
(#307) - Add support for implicit route model binding (#315)
- Add support for passing parameters to
current()
to check against the current URL in addition to the route name (#330)
Changed
⚠️ Updateziggy:generate
output path for Laravel 5.7+resources
directory structure, thanks @Somethingideally! (#269)⚠️ Update automaticid
parameter detection to check for higher priority named route parameters and allow passingid
as a query parameter (#301)⚠️ Rename theRoutePayload
class toZiggy
and remove itscompile
method in favour of constructing a new instance and calling->toArray()
or->toJson()
(#305)- Resolve the application router instance internally instead of passing it into the constructor –
new Ziggy(...)
now takes only 2 arguments,$group
and$url
- Change the default value of
basePort
fromfalse
tonull
- Remove the
getRoutePayload()
methods on theBladeRouteGenerator
andCommandRouteGenerator
classes
- Resolve the application router instance internally instead of passing it into the constructor –
⚠️ Rename allwhitelist
andblacklist
functionality toonly
andexcept
(#300)- Use Jest instead of Mocha for JS tests (#309)
- Use microbundle instead of Webpack to build and distribute Ziggy (#312)
⚠️ Default Ziggy'sbaseUrl
to the value of theAPP_URL
environment variable instead ofurl('/')
(#334)⚠️ Return a literal string from theroute()
function when any arguments are passed to it (#336)⚠️ RenamenamedRoutes
→routes
,defaultParameters
→defaults
,baseUrl
→url
, andbasePort
→port
(#338)⚠️ Make thefilter()
method on theZiggy
class return an instance of that class instead of a collection of routes (#341)⚠️ Make thenameKeyedRoutes()
,resolveBindings()
,applyFilters()
, andgroup()
methods on theZiggy
class, and thegenerate()
method on theCommandRouteGenerator
class, private (#341)⚠️ Export fromindex.js
instead ofroute.js
(#344)⚠️ Encode boolean query parameters as integers (#345)⚠️ Ensure.current()
respects the value of theabsolute
option (#353)
Deprecated
- Deprecate the
with()
andcheck()
methods (#330)
Removed
⚠️ RemoveRoute
Facade macrosRoute::only()
andRoute::except()
(previouslyRoute::whitelist()
andRoute::blacklist()
) (#306)⚠️ Remove the following undocumented public properties and methods from theRouter
class returned by theroute()
function (#330):name
,absolute
,ziggy
,urlBuilder
,template
,urlParams
,queryParams
, andhydrated
normalizeParams()
,hydrateUrl()
,matchUrl()
,constructQuery()
,extractParams()
,parse()
, andtrimParam()
⚠️ Remove theUrlBuilder
class (#330)⚠️ Remove theurl()
method now thatroute(...)
returns a string (#336)⚠️ Remove thebaseDomain
andbaseProtocol
properties on the Ziggy config object (#337)⚠️ Remove theappendRouteToList()
,isListedAs()
,except()
, andonly()
methods from theZiggy
class (#341)
Fixed
- Fix automatic
id
parameter detection by also excluding routes with an optionalid
parameter ({id?}
), thanks @Livijn! (#263) - Fix port not being added to URL for routes with subdomains (#293)
- Fix getting parameters of routes in apps installed in subfolders (#302)
- Ensure fallback routes are always last, thanks @davejamesmiller! (#310)
- Allow getting the route name with
current()
when the current URL has a query string (#330)
v0.9.4 - 2020-06-05
Fixed
- Fix escaping of
.
characters in thecurrent()
method, thanks @davejamesmiller! (#296)
v0.9.3 - 2020-05-08
Added
- Add support for passing a CSP
nonce
attribute to the@routes
Blade directive to be set on the script tag, thanks @tminich! (#287)
Changed
- Improve support for using Ziggy with server-side rendering, thanks @emielmolenaar! (#260)
- Avoid resolving the Blade compiler unless necessary, thanks @axlon! (#267)
- Use
dist/js/route.js
as the npm package's main target, thanks @ankurk91 and @benallfree! (#276) - Readme and quality-of-life improvements (#289)
Fixed
- Ensure Ziggy's assets are always generated in the correct location (#290)
For previous changes see the Releases page.