May 13, 2022
0
Level 7
Are changes to URL facade persisting between requests?
For example, lets say I'm generating signed URL's for a tenant application and I want to change the base URL used in the URL facade:
// update base url
URL::formatHostUsing(function () {
return 'https://google.com';
});
// generate a signed used the new domain
URL::temporarySignedRoute(
'subscribe', now()->addMinutes(30), ['user' => 1]
);
// is this reset needed? Or is it just persisted until the end of this request? Can other users performing a request at the same moment, generate url's using the wrong domain?
URL::formatHostUsing(function () {
return config('app.url');
});
Thanks!
Please or to participate in this conversation.