Description
Using Laravel Named Routes Within JavaScript
Overview
Ziggy offers a route() helper function for JavaScript that mirrors the functionality of Laravel’s native route helper. This enables seamless access to your application’s named routes directly from client‑side code.
How It Works
A Blade directive is generated and can be included in your views. When rendered, it exports:
- A JavaScript object containing all of your application's named routes, indexed by their aliases.
- A global
route()function that allows you to generate URLs for these routes within your JavaScript logic.
Related Projects
Laravel Artifact
Media Management Package
Mirror
Impersonation Package
LaravelPlus Updater
Sync Laravel Projects
Laravel Credits
Credit Management System
Laravel Glider
Glide Image Manipulation in Blade Templates
Laravel Ownable
Eloquent Ownership Relationships