Replies: 5 comments 1 reply
-
How exactly would you use this? Unless you're using Inertia the output of |
Beta Was this translation helpful? Give feedback.
-
The primary use-case that led me to this is specifically when using Inertia. It's also fine that it would be reloaded with each request. To give you an example, imagine a route group like this that includes the vast majority of the sites routes: Route::domain('{tenants_subdomain}.domain.tld')->group(function () {
// Routes
}); The route parameter name is dynamic, as it was added on behalf of the What I hope to do, is provide a small bit of code that users can add, which will automatically set the value for the |
Beta Was this translation helpful? Give feedback.
-
I am currently facing this exact scenario also. I am using Inertia.
This works fine when the initial page load is on a However, if the user arrives on the login page, then is redirected to a
Is there a way to update the sharedData for partial reloads? Or a way to hook into it? |
Beta Was this translation helpful? Give feedback.
-
i also face the same problem, with multi tenancy, Yes Share data can solve the problem, but we need to hard code every route when we use. example |
Beta Was this translation helpful? Give feedback.
-
See #567 (comment) about making the full Ziggy config (including defaults) available dynamically at runtime. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Description
When the route definitions are dumped out so Ziggy can work with them, it includes all current default parameters, but it doesn't have support for runtime default parameters.
I've built a multitenancy package that contains features that use route parameters to identify tenants. Within Laravel, I can set the default value for the route parameter once the tenant is identified, so that users don't have to provide its value when using
route()
etc.Suggestion
Add controls to add or remove default route parameter values. I believe it just needs to be something that modifies
_config.defaults
and adds the mapping, but I'm not confident enough in my Typescript abilities to add it myself.ziggy/src/js/Router.js
Lines 270 to 287 in 73abf72
Beta Was this translation helpful? Give feedback.
All reactions