{{-- 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
{{ __('admin.ai.entity_badge.title') }} {{ trans_choice('admin.ai.entity_badge.actions_count', $logCount, ['n' => $logCount]) }} @if ($lastLog) · {{ __('admin.ai.entity_badge.last_by', [ 'admin' => $lastLog->admin?->name ?: $lastLog->admin?->email ?: '—', 'action' => $lastLog->action_type, 'when' => $lastLog->created_at?->diffForHumans(), ]) }} @endif {{ __('admin.ai.entity_badge.view_history') }} →