| 1 | <?php | ||
| 5 | trait FreshCreatedAt | ||
| 6 | { | ||
| 7 | /** | ||
| 8 | * Set the value of the "created at" attribute. | ||
| 9 | * | ||
| 10 | * @param mixed $value | ||
| 11 | * @return $this | ||
| 12 | */ | ||
| 13 | abstract public function setCreatedAt($value); | ||
| 14 | |||
| 15 | /** | ||
| 16 | * Get a fresh timestamp for the model. | ||
| 17 | * | ||
| 18 | * @return \Carbon\Carbon | ||
| 19 | */ | ||
| 20 | abstract public function freshTimestamp(); | ||
| 21 | |||
| 22 | /** | ||
| 23 | * Boot the trait. | ||
| 24 | * | ||
| 25 | * Add a creating observer, set the value of the "created_at" attribute. | ||
| 26 | */ | ||
| 27 | protected static function bootFreshCreatedAt() | ||
| 33 | } | ||
| 34 |