@extends('_version_01.iot.layouts.admin') @section('content') @include('_version_01.iot.layouts.partials._alert') @php $content_keys = ['title','content']; @endphp
@include('_version_01.iot.layouts.partials._index_header')
@foreach($cols as $col) @php if($col == 'device_profile_id'){ continue; } @endphp @if($col == 'id') @elseif(str_contains($col, '_id')) @else @endif @endforeach @php $counter = 0; @endphp @foreach($model as $index => $row) @php //echo $row['cover_photo_path'].'
'; @endphp @foreach($row->toArray() as $key => $value) @php if(!in_array($key,$cols)) { continue; } @endphp @if(in_array($key,$content_keys)) @php $d_value = json_decode($value,true); $cv = ''; if($d_value != null) { if(isset($d_value['en'])) { $cv = $d_value['en']; }else if(isset($d_value['english'])) { $cv = $d_value['english']; } } @endphp @elseif($key == 'category_id') @php $title = ''; $c = App\Models\Category::find($value); if($value != 0) { $t_title = json_decode($c['title'] , true); if($t_title != null) { if(isset($t_title['en'])) { $title = $t_title['en']; }else if(isset($t_title['english'])) { $title = $t_title['english']; } } } @endphp @elseif($key == 'cover_photo_path') @elseif($key == 'gallery_photos') @php //dd($value); $photos = json_decode($value,true); @endphp @elseif($key == 'photo') @elseif($key == 'status') @elseif($key != 'user_id' && $key != 'id') @endif @endforeach @php $counter ++; @endphp @endforeach
#{{App\Models\Language::trans(ucwords(str_replace('_id', '', $col)))}}{{App\Models\Language::trans(ucwords(str_replace('_', ' ', $col)))}}{{App\Models\Language::trans('Action')}}
{{$counter+1}}{{$cv}} {{ $title }} @if(is_array($photos)) @foreach($photos as $photo) @php //dd($photo); @endphp @endforeach @endif {{$row->display_status_string($key)}}{{$value}} {{App\Models\Language::trans('Edit')}}
@endsection @section('script') @endsection