Support the ongoing development of Laravel.io →
posted 10 years ago
Eloquent
Last updated 2 years ago.
0

I also noticed this one. I created them manually instead on my schema builder and added

->default(DB::raw('CURRENT_TIMESTAMP'));
Last updated 2 years ago.
0

Found it out :) … instead of insert i have to use create.

Last updated 2 years ago.
0

Eloquent only use updated_at and created_at if $timestamps is set to true in your models. If you don't want to use it in your model set it to false.

Read http://laravel.com/docs/eloquent#timestamps

class Model extends Eloquent {
    ...
    public $timestamps = false;
    ...
}

One thing you should never do is to rely on DB::raw('CURRENT_TIMESTAMP') as your database (MySQL) doesn't know what timezone you have set in your config.

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

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.