Display date from database in datepicker inside component

Hi All

I’m having some trouble getting the date from the database in the datepicker in my component using the edit method. Currently its just showing the standard ‘dd/mm/yyyy’ but not the value from the database. I’ve tried formatting the date as a protected date in the model, ive also tried using carbon to format the date multiple different ways such as Mozilla Date Picker but still no joy.

In my component i have: <input wire:model="purchased_at" type="date"...
and in the controller in the edit method i have the following with the last attempted formating of the date:-

$this->purchased_at = Carbon::parse($record->purchased_at)->format('yyyy-mm-dd');

Please could someone advise how best to do this.

Thanks in advance.

Try ->format('Y-m-d')

Remember the date format is according to php formatting, not Javascript

Thanks @Snapey, much appreciated.