'datetime', 'created_at' => 'datetime', 'updated_at' => 'datetime', ]; protected $attributes = [ 'platform' => 'web', ]; /** * Get the related content (polymorphic relationship) */ public function content() { if ($this->content_type === 'meme') { return $this->belongsTo(MemeMedia::class, 'content_id'); } if ($this->content_type === 'background') { return $this->belongsTo(BackgroundMedia::class, 'content_id'); } return null; } }