Closed tonysilva16 closed 3 years ago
Can you share more details about your setup and what exactly appears to be wrong? Does your app URL change from one request to the next?
The url does not change from one request to the next. I think the problem is that the url is only retrieved on the contructor of the ziggy class, and octane is not reseting that property (payload)
public function __construct($group = null, string $url = null)
{
$this->group = $group;
$this->url = rtrim($url ?? url('/'), '/');
$this->port = parse_url($this->url)['port'] ?? null;
$this->routes = $this->nameKeyedRoutes();
}
Okay, can you please share more details about your specific situation though? If the app URL is the same on every request to your app, it shouldn't matter if Ziggy only checks the URL once since it'll be the same every time.
Please include your Ziggy configuration if possible.
Its a multi tenancy application, each tenant has a "subdomain"
{
"url": "http://jVskklMMRjZOWjbkjQLs.dev.localhost",
"port": null,
"defaults": {
"shopId": "zkGfyhccXCenYvCbJXHu"
},
"routes": {
........
}
}
The url should be http://zkGfyhccXCenYvCbJXHu.dev.localhost
Okay so your app's URL is not the same on every request 😅 I'll work on a fix for this, we can probably still get away with caching most of the payload but you're right the URL will have to not be persisted.
yeah, i see that know, i understood you were asking other thing... 🤣
Ziggy version
v1.4.0
Laravel version
v8.58
Description
ZiggyServiceProvider has a listener responsible to reset the state for current request and is setting the property generated to false, but the payload on the BladeRouteGenerator class is not changed so it returns the wrong url for the current request. This does not happen on 1.1.0, thats the version i am currently using
Ziggy call and context
Ziggy configuration
Route definition