you don't need them, they are there for you use, so you can add to your model class public $timestamps = false;, or but if your using a model etc these normally fill in automatically anyways, so you dont need to try or add then in your entry code.
Leaving the fields created_at and updated_at empty in a database table?
Hi, I am creating some database migrations for cities and states in Laravel, they both have the created_at, and the updated_at fields, now I am trying to fill in those using an SQL script that I have found online, this is the way I will be able to do it , so My Question: is it OK if I leave them empty, and whether in any case I will have some issues if I leave them empty now, my web application is expected to scale in the future.
For tables that don't need timestamps, don't add $table->timestamps(); to your migration. If you don't add them, you must do as @simondavies says and add public $timestamps = false; to the model. If you don't use Eloquent at all and don't define a model, just don't add the timestamps. Finally, don't just copy/paste SQL you find on the internet to make your app work. Eloquent is a wonderful thing, watch the casts here and learn how to use it. IMHO, copy/paste doesn't scale--knowledge does.
Please or to participate in this conversation.