@extends('layouts.app') @section('center')

Devices list

Export to Excel
@php $i = 1; function renderDeviceRow($device, $level = 0, $prefix = '') { global $i; // Adjusted indent for visual clarity $indent = str_repeat('     ', $device->installed_on === 'connection' ? 4 : $level); $icon = match($device->installed_on) { 'transformer' => 'icon-zap', // 🟢 represents electronic device 'pole' => 'icon-anchor', // 🟠 stable, grounded icon (closest visual match to pole) 'connection' => 'icon-cpu', // 🔌 electrical connection default => 'icon-flickr' // ⚠️ default warning }; $colorClass = match($device->installed_on) { 'transformer' => '#0d47a1', //info - blue 'pole' => '#1b5e20', 'connection' => '#000000', // green// same for all connections default => 'warning' }; $boldOpen = $device->installed_on === 'transformer' ? '' : ''; $boldClose = $device->installed_on === 'transformer' ? '' : ''; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; if ($device->children && $device->children->count()) { // 1. Show connections first (with deep indent) foreach ($device->children->where('installed_on', 'connection') as $child) { renderDeviceRow($child, $level, ''); // fixed level for all connections } // 2. Then poles and other devices (recursive) foreach ($device->children->where('installed_on', '!=', 'connection') as $child) { renderDeviceRow($child, $level + 1, '↳'); } } } @endphp @foreach ($devices as $device) @php renderDeviceRow($device); @endphp @endforeach
# Global Device ID Installed On Mode Meter Type Meter Category
" . $i++ . "{$indent}{$prefix} {$boldOpen} {$device->global_device_id}{$boldClose} {$device->installed_on}" . ($device->dmdt_bidirectional_device ? 'Gross Meter' : 'Net Meter') . "" . ($device->dmdt_phase) . " Phase" . ($device->category) . "
@push('scripts') @endpush @endsection