'datetime', ]; public function memes() { return $this->hasMany(Meme::class)->orderByDesc('created_at'); } public function tips() { return $this->hasManyThrough(Tip::class, Meme::class, 'id', 'address_id'); } public function getMemesTotalAttribute() { return $this->memes->count(); } public function getTipsTotalAttribute() { return $this->tips->sum('amount_formatted'); } }