Support the ongoing development of Laravel.io →
Database Eloquent
Last updated 1 year ago.
0

You can read the Carbon docs here:

https://github.com/briannesbitt/Carbon

As you can see, all you have to do is access the "timestamp" property. Like this:

$timestamp = $user->created_at->timestamp
Last updated 1 year ago.
0

I read laravel docs and override the getDateFormat. Then created in the migration of three fields

$table->integer('created_at');
$table->integer('updated_at');
$table->integer('deleted_at');

and it works. Thx.

Last updated 1 year ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

ritsufag ritsufag Joined 21 Feb 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.