Skip to content

Commit

Permalink
Add information on how to edit created_at and updated_at columns
Browse files Browse the repository at this point in the history
  • Loading branch information
Arjan Weurding committed Nov 1, 2016
1 parent 3e9397a commit 76b9f7f
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions eloquent.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,27 @@ If you need to customize the format of your timestamps, set the `$dateFormat` pr
protected $dateFormat = 'U';
}

If you need to use a different name for the `created_at` and `updated_at` fields in your table, set the `CREATED_AT` and `UPDATED_AT` constants in your model:

<?php

class Flight extends Model
{
/**
* The name of the "created at" column.
*
* @var string
*/
const CREATED_AT = 'creation_date';

/**
* The name of the "updated at" column.
*
* @var string
*/
const UPDATED_AT = 'last_update';
}

#### Database Connection

By default, all Eloquent models will use the default database connection configured for your application. If you would like to specify a different connection for the model, use the `$connection` property:
Expand Down

0 comments on commit 76b9f7f

Please sign in to comment.