belongsTo('App\Account'); } /** * Get the Entry title. * * @param string $value * @return string */ public function getTitleAttribute($value) { return $value; } /** * Get the Entry post. * * @param string $value * @return string */ public function getPostAttribute($value) { return $value; } /** * Get all the information of the Entry for the journal. * @return array */ public function getInfoForJournalEntry() { // Default to created_at, but show journalEntry->date if the entry type is JournalEntry $entryDate = $this->journalEntry ? $this->journalEntry->date : $this->created_at; return [ 'type' => 'activity', 'id' => $this->id, 'title' => $this->title, 'post' => $this->post, 'day' => $entryDate->day, 'day_name' => \App\Helpers\DateHelper::getShortDay($entryDate), 'month' => $entryDate->month, 'month_name' => \App\Helpers\DateHelper::getShortMonth($entryDate), 'year' => $entryDate->year, ]; } }