*/ protected $fillable = [ 'user_id', 'subject_id', 'content', 'type', 'metadata', 'input_tokens', 'output_tokens', 'sent_at', ]; /** @var array */ protected $casts = [ 'metadata' => 'array', 'sent_at' => 'datetime', 'type' => MessageType::class, ]; /** * Get the user that owns the insight. */ public function user(): BelongsTo { return $this->belongsTo(User::class); } /** * Get the subject associated with the insight. */ public function subject(): BelongsTo { return $this->belongsTo(Subject::class); } }