I am working on Laravel 4 application and would like to save the unix timestamp for the created_at and updated_at fields instead of the default timestamp values.
Any suggestions on how I could achieve this?
Regards,
you can just get the timestamp property, as:
$timestamp = $model->created_at->timestamp;
or, you could override the getDateFormat(), and create migration of required fields, as:
$table->integer('created_at');
$table->integer('updated_at');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With