ID ({{ count($model_list) }}) @php // Convert the comma-separated string into an array, trim whitespace $columns = array_map('trim', explode(',', $model_description)); @endphp @foreach($columns as $col) {{ strtoupper(str_replace('_', ' ', $col)) }} @endforeach @cannot('help-desk-access') ACTION @endcannot @foreach($model_list as $model_item) {{ $model_item->id }} @foreach($columns as $col) {{ $model_item->$col ?? '' }} @endforeach @cannot('help-desk-access') open actions {{-- Include your modals here --}} @include('management-lookups.edit-modal', ['model_name' => $model_name, 'model_item' => $model_item]) @endcannot @endforeach