Defining Routes
When using Inertia, all of your application’s routes are defined server-side. This means that you don’t need Vue Router or React Router. Instead, you can simply define Laravel routes and return Inertia responses from those routes.Shorthand Routes
If you have a page that doesn’t need a corresponding controller method, like an “FAQ” or “about” page, you can route directly to a component via theRoute::inertia() method.
Generating URLs
Some server-side frameworks allow you to generate URLs from named routes. However, you will not have access to those helpers client-side. Here are a couple ways to still use named routes with Inertia. The first option is to generate URLs server-side and include them as props. Notice in this example how we’re passing theedit_url and create_url to the Users/Index component.
Wayfinder
When using Wayfinder, you can pass the generated TypeScript method directly to the Link component, form helpers, or router methods and Inertia understand how to handle it. In fact, if you are developing an application using one of Laravel’s starter kits, Wayfinder is already configured for you.Ziggy
The Ziggy library can make your named, server-side routes available to you via a globalroute() function. If you’re using the Vue plugin included with Ziggy, you may use the route() function directly in your templates.
ssr.js file. This should include the route definitions and current location.
Customizing the Page URL
The page object includes aurl that represents the current page’s URL. By default, the Laravel adapter resolves this using the fullUrl() method on the Request instance, but strips the scheme and host so the result is a relative URL.
If you need to customize how the URL is resolved, you may provide a resolver within the urlResolvermethod of the Inertia HandleInertiaRequests middleware.
Inertia::resolveUrlUsing() method.