public function getLastHistoryRecord() { $record = $this->histories()->orderBy('created_at', 'DESC')->first(); if ($record) { return $record; } return false; }