<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Attributes\Fillable;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\MorphTo;

/**
 * A link from a conversation to something it produced.
 *
 * Deliberately a link and not ownership: deleting a chat must never delete a
 * campaign that is live on a platform.
 */
#[Fillable(['conversation_id', 'artifactable_type', 'artifactable_id', 'created_by_message_id'])]
class ConversationArtifact extends Model
{
    public function artifactable(): MorphTo
    {
        return $this->morphTo();
    }
}
