insert([ 'action' => $action, 'actor_id' => $actor, 'tenant_id' => $tenant, 'company_id' => $company, 'unit_id' => $unit, 'subject_id' => $subject, 'details' => json_encode($safe, JSON_THROW_ON_ERROR), 'created_at' => now(), ]); } }