'boolean', 'is_carousel' => 'boolean', 'like_count' => 'integer', 'comment_count' => 'integer', 'taken_at' => 'integer', 'carousel_images' => 'array', 'scraped_at' => 'datetime', 'taken_at_date' => 'datetime', 'permalink' => 'string', ]; protected $appends = [ 'permalink', 'taken_at_date', ]; /** * Instagram's taken_at is a unix timestamp - convenience accessor * for an actual Carbon instance. */ protected function takenAtDate(): Attribute { return Attribute::make( get: fn () => $this->taken_at ? Carbon::createFromTimestamp($this->taken_at) : null, ); } /** * Convenience: the actual instagram.com URL for this post. */ protected function permalink(): Attribute { return Attribute::make( get: fn () => $this->code ? "https://www.instagram.com/p/{$this->code}/" : null, ); } }