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

HopesAreMiracle's avatar

Want to keep showing old date for date field !!

I want to have my date field remember my old input after reloading or going to next page.

Is there any way i can do this?

I already tried this way !!

0 likes
5 replies
Vilfago's avatar

We don't see your code, put it between ```

Are you talking about date field manage by Eloquent such as updated_at and created_at ?

HopesAreMiracle's avatar

Sorry here is my code.

< input type= " date " id = " to_date " name = " to_date " value = " {{ old ( 'to_date' ) }} " >

Vilfago's avatar

Could we see your controller, or how you redirect / go to next page ?

HopesAreMiracle's avatar

This is a little confusing , i add action event on my blade.

< a class = "btn btn-primary" onclick="window.location.href='/wallets/ledger?to_date='+to_date.value"> Go

In the controller ,

return view('wallets.ledger') ;

HopesAreMiracle's avatar
Level 1

Oh I got it now . Thanks @Vilfago .

I need to change like this

return view('wallets.ledger' , [ 'from_date' => $from_date] );

Its work now. Thanks.

Please or to participate in this conversation.