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

hamzaelmaghari's avatar

Laravel Model Date Serialization

Hello, devs, I recently started using Laravel model Date Serialization (https://laravel.com/docs/9.x/eloquent-serialization#customizing-the-default-date-format) with VueJs that was working fine but when I moved to Livewire and tried to return Carbon date instance (the same as above) for the model it didn't work.

I expected to get 13-01-2023 but I received 2023-01-13 17:49:31

0 likes
2 replies
tykus's avatar
tykus
Best Answer
Level 104

There is no JSON serialization in Livewire; you can format the Carbon instance in the Blade template instead

1 like
hamzaelmaghari's avatar

@tykus Thanks for the info I didn't know that <3 now I'll move to another method I can do :)

Please or to participate in this conversation.