/** * Get the children. * * @return \Luminous\Bridge\Post\Query\Builder */ protected function getChildrenAttribute() { return WP::posts($this->type)->wherePost('parent_id', $this->id); }
/** * Get the older post. * * @return \Luminous\Bridge\Post\Entity|null */ public function getOlderAttribute() { return WP::posts($this->type)->whereDate('created_at', '<', $this->created_at)->orderBy('created_at', 'desc')->first(); }