Requirements
Ziggy 2.x requires:- Laravel 9 or higher
- PHP 8.1 or higher
Breaking Changes
Namespace Change
Note: The Composer package name (tightenco/ziggy) has not changed.
Before:
1
Update namespace imports
Search your codebase for
Tightenco\Ziggy and replace with Tighten\Ziggy.2
Clear cached files
Run
php artisan config:clear and php artisan route:clear to clear any cached references.JavaScript Module Changes
Before:Vue and React Import Changes
Before:Build Changes
Ziggy 2.x provides the following builds:- Default build:
./dist/index.js- Supports all modern browsers (default when importing fromziggy-jsorvendor/tightenco/ziggy) - Legacy ES Module:
./dist/index.esm.js- Uses fewer new language features for broader compatibility - UMD build:
./dist/route.umd.js- For internal use in Ziggy’s@routesBlade directive
Method Removal
Before:PHP Internal Changes
Overriding this method is no longer supported. If you were extending this class and overridingmakeDirectory, you’ll need to find an alternative approach.
Migration Steps
1
Update Composer dependencies
Update your
composer.json to ensure you’re running Laravel 9+ and PHP 8.1+:2
Update PHP namespace imports
Replace all instances of
Tightenco\Ziggy with Tighten\Ziggy in your PHP files.3
Update JavaScript imports
Replace default imports with named imports:
4
Update Vue/React imports
Move Vue and React imports from subpaths to the root module:
5
Replace check() with has()
Search for
route().check( and replace with route().has(:6
Test your application
Thoroughly test all routes and navigation in your application to ensure everything works correctly.
7
Clear all caches
Summary of Changes
Complete list of breaking changes
Complete list of breaking changes
- PHP namespace:
Tightenco\Ziggy→Tighten\Ziggy(Composer package name unchanged) - JavaScript exports: Default export removed, use named exports only
- Import paths: Vue/React imports moved from subpaths to root module
- Build formats: Only ES Module builds included (no CommonJS)
- Method removal:
check()method removed (usehas()instead) - Internal methods:
makeDirectorymethod ofCommandRouteGeneratoris now private - Requirements: Laravel 9+ and PHP 8.1+ required
Getting Help
If you encounter issues during the upgrade process:- Review the GitHub releases for detailed changelogs
- Check existing issues or open a new one
- Consult the Ziggy documentation for updated usage examples