{{-- Merchant Users Table Component Used for displaying assigned users with split permissions @param array $assignedUsers - Collection of assigned users @param array $currentSplits - Current split data for users @param array $splitTypes - Available split types @param array $payOrders - Available pay order options @param int $merchantId - The merchant ID for history links @param bool $showActions - Whether to show action buttons (default: true) @param string $tableId - Unique table ID (default: 'merchant-users-table') --}} @php // Accept multiple possible variable names for flexibility $assignedUsers = $assignedUsers ?? $merchantUsers ?? collect(); $currentSplits = $currentSplits ?? $splits ?? collect(); $showActions = $showActions ?? true; $tableId = $tableId ?? 'merchant-users-table'; $totalPercentage = 0; // Ensure we have a collection-like structure for splits if(!($currentSplits instanceof \Illuminate\Support\Collection)) { $currentSplits = collect($currentSplits); } // Provide split types if not passed in if(!isset($splitTypes) || empty($splitTypes)) { $userModelTmp = new \App\Models\User(); $splitTypes = \App\Helpers\Helper::makeSimpleArray($userModelTmp->splitTypes, 'id,name'); } @endphp