Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

manof360's avatar

temporary Signed Route end in specific date laravel

I have a table for Volunteer offers and I want to make link for the offers for Volunteers . I want the url ends in specific date.. i make this cod so far

$url = URL::temporarySignedRoute(
            'volunteer_apply', now()->addDays(), ['volunteer' => $volunteer, 'locale'=>app()->getLocale() ]
        );

this is the route

Route::get('volunteer_apply', function (Request $request) {

        return view('user.home.volunteer_apply');

    })->name('volunteer_apply')->middleware('signed');

and is the middleware

 'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class,

the problem her I cant find a method to make the temporary url ends in specific date as 25/02/2020

0 likes
2 replies
Snapey's avatar
Snapey
Best Answer
Level 122

pass a carbon object with the end datetime tothe function

$ending = Carbon::parse('25/02/2020');

$url = URL::temporarySignedRoute(
        'volunteer_apply', $ending, ['volunteer' => $volunteer, 'locale'=>app()->getLocale() ]
    );
1 like

Please or to participate in this conversation.