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

I don't think theres a way to only use created_at, timestamps are either on or off. I guess you could turn off the laravel ones and roll with your own code to just use created_at.

Anyway, you can turn off the laravel functionality by adding the following to your models.

protected $timestamps = false;
Last updated 2 years ago.
0

Si on regarde la définition de la méthode timestamps (Laravel 5 tout du moins) on peux voir que la méthode se contente juste d'appeler deux fois la méthode timestamp() pour générer un champ created_at et updated_at.

Du coup si tu veux gérer uniquement le created_at il suffit juste de remplacer l'appel à timestamps() par un timestap('created_at');

EDIT : désolé pour le déterrage, c'est pour ceux comme moi qui chercherais la solution.

Last updated 9 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

alex-mn alex-mn Joined 30 Jun 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.