Why carbon format not working?

Posted 3 weeks ago by RidwanIslam

I want to change format of created_at column. Normally it show 2018-10-03 04:38:58. Now I want to show d-m-Y format but it's not working.

Here is my code-


$user = User::find(1);

return \Carbon\Carbon::parse($user->created_at)->format('d-m-Y');

Any suggestion?

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.