Change column names used to save timestamp

2

When storing or editing data in a table by laravel it creates a timestamp that uses the created_at and updated_at

But I have to store the data in a table shared with another system, and it uses another nomenclature to store this data.

Without being the solution to set timestamp = false and at the time of storing myself add timestamp there.

In% itself, how can I set the name of model and creted_at to another?

    
asked by anonymous 13.11.2017 / 17:00

1 answer

1

I found this example in the Laravel documentation and worked out

  

If you need to customize the names of the columns used to store the timestamps, you may set the CREATED_AT and UPDATED_AT constants in your model:       

class Flight extends Model
{
    const CREATED_AT = 'creation_date';
    const UPDATED_AT = 'last_update';
}
    
13.11.2017 / 19:40