I'm using Laravel 8 to generate a temporary signed route and pass some params, but I'd like my URL to take me to some URL of my choosing rather than a page in my project.
For context, my Laravel 8 project is an API, so there are no views, my API is then consumed by a front-end project written in Nuxt.
I've tried adding my URL to the first arg of temporarySignedRoute but it says that my route isn't found.
$verifyURL = URL::temporarySignedRoute(
'https://example.com/account/verify', Carbon::now()->addHours(24), ['contact' => 5, 'team' => 'john']
);
What am I missing or what workaround is there here?
UPDATE
So it turns out that I don't need to take the user to an external URL, but it seems that the wrong URL is being generated by URL::temporarySignedRoute.
The start of my generated URL is (for example) https://example.com/api/contact/verify and I need the URL to be https://api.example.com/api/contact/verify
So the same domain, except a sub-domain.
It looks like the APP_URL isn't being read because I changed it and it has no impact, and besides, this is used elsewhere, so I tried updating the URL with:
$verifyURL = URL::temporarySignedRoute(
'contact.verify', Carbon::now()->addHours(24), ['contact' => 5, 'team' => 'john]
);
// fix for wrong URL
$verifyURL = str_replace('example.com', 'api.example.com', $verifyURL);
However, this appears to have an invalid signature when the link provided by $verifyURL is clicked? How can I get the api part at the beginning?