Laravel URL Generation: URLs For Named Routes
Allow you to generate URLs without being coupled to the actual URL defined on the route.
Signed URLs
Use Illuminate\Support\Facades\URL;
return URL::temporarySignedRoute(
'unsubscribe', now()->addMinutes(30), ['user' => 1]
);
- Laravel allows you to easily create "signed" URLs to named routes.
- Have a "signature" hash appended to the query string which allows Laravel to verify that the URL has not been modified since it was created.
- Are especially useful for routes that are publicly accessible yet need a layer of protection against URL manipulation.