public function beforeCreate() { $this->createdAt = date('Y-m-d H:i:s'); $this->updatedAt = $this->createdAt; }