I want only use created_at , how to do it?
I know:
This can custom timestamps name
const CREATED_AT = \'created\';
const UPDATED_AT = \'updat
I have a better answer from here for Laravel 5.2 or above.
U can use this in model-
class User extends Model
{
public $timestamps = false; // disable all behavior
public $timestamps = true; // enable all behavior
public $timestamps = [ "created_at" ]; // enable only to created_at
public $timestamps = [ "updated_at" ]; // enable only to updated_at
public $timestamps = [ "created_at", "updated_at" ]; // same as true, enable all behavior
}
So, for your question, the answer is -
public $timestamps = [ "created_at" ]; // enable only to created_at
public $timestamps = [ "created_at" ];
Not working in Laravel 6+