{{-- Compact AI activity strip rendered on entity show pages (investor + startup). Shows recent Claude touches at a glance + a drill-down link to the activity log filtered by this subject. Props: $subject — the model (Investor or Startup) being viewed. --}} @php use App\Models\AiActivityLog; $morph = $subject->getMorphClass(); $sid = $subject->getKey(); $logCount = AiActivityLog::query() ->where('subject_type', $morph) ->where('subject_id', $sid) ->count(); if ($logCount === 0) { // Nothing to show — render nothing. Keeps the page clean for // records Claude hasn't touched. return; } $lastLog = AiActivityLog::query() ->where('subject_type', $morph) ->where('subject_id', $sid) ->with('admin:id,name,email') ->orderByDesc('id') ->first(); @endphp