chinleung / laravel-multilingual-routes

A package to handle multilingual routes in your Laravel application.
https://github.com/chinleung/laravel-multilingual-routes-demo
MIT License
395 stars 25 forks source link

Add URL signing for localized routes #78

Closed fyrts closed 8 months ago

fyrts commented 8 months ago

I've implemented signedLocalizedRoute and temporarySignedLocalizedRoute macros for Laravel's UrlGenerator, analogous to signedRoute and temporarySignedRoute.

use Illuminate\Support\Facades\URL;

return URL::signedLocalizedRoute('unsubscribe', ['user' => 1]);
use Illuminate\Support\Facades\URL;

return URL::temporarySignedLocalizedRoute(
    'unsubscribe', now()->addMinutes(30), ['user' => 1]
);