Open harlekoy opened 6 years ago
Temporary fix will be something like this
app('api.url')
->version('v1')
->setKeyResolver(->setKeyResolver(function () {
return config('app.key');
}))
->temporarySignedRoute('route.name',
now()->addDay(), ['id' => 1]
)
Looks good @harlekoy , @thilanga - might having a look?
now ,it 's not work.
@jourdon Can you be more specific please? What version of this package are you using? What is the error you are getting?
Actual Behaviour
First i tried using the Laravel signed URL feature with
QUEUE_DRIVER
set tosync
and its working fine, like this code below:But when I change it my
QUEUE_DRIVER
toredis
I got an issue saying Route 'route.name' is not defined.so instead of using the normal
URL
facade of Laravel, I used something like this:now the error is showing that the
keyResolver
is set toNULL
. So I check how Laravel registered theirIlluminate\Routing\UrlGenerator
and found this inIlluminate\Routing\RoutingServiceProvider
Click here to see the code
Expected Behaviour
It should allow me to successfully make a signed URL
Steps to Reproduce
Just create a mail class like this having your URL link for the email and set your
QUEUE_DRIVER
to anything aside fromsync
in my end I usedredis
:Possible Solutions
Just insert this code in the
Dingo\Api\Provider\RoutingServiceProvider
in line 55:
and it should successfully create the signed URL you want