mardi 22 mars 2022

Pass date in url in Laravel

I have this Link in my view

 <a href="">
 Link
 </a>

when i click on this link this url is called

detail?id=2&date=03-22-2022

getting this error :

Could not parse '03-22-2022': DateTime::__construct(): Failed to parse time string (03-22-2022) at position 0 (0): Unexpected character

but if my url is

detail?id=1&date=03%2F22%2F2022

then it is working how can i urlencode in laravel

Controller:

public function Detail(Request $request)
    {
         
        $start_date=date('Y-m-d H:i:s', strtotime($request->date));
    }

Thanks



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/gSXUP4v
via IFTTT

Aucun commentaire:

Enregistrer un commentaire