@php $from_time = $from; $to_time = $to; @endphp @foreach ($arr as $k => $v) @php $widget = \App\Models\SplunkSearches::where('id',$v)->with(['tableHeadingDescriptions'])->first(); $from = $from_time; $to = $to_time; @endphp @if($widget) @php if ($widget->period_only) { $from = $widget->period_from; $to = $widget->period_to; } @endphp @if ($widget->widget_type) {{-- replaced with gate check ? --}} {{-- @if(!\App\Models\SplunkSearchesRelation::widgetHaveAccess($widget->id)) @if(in_array($from, \App\Models\SplunkCache::$periods_allowed) && \App\Models\SplunkCache::getInfo($from, $widget->id, Auth::id())) @include('splunk_cache_code_generator.' . $widget->widget_type) @else @include('code_generator.' . $widget->widget_type) @endif @else--}} {{--@if(\App\Models\SplunkSearchesRelation::checkAssessWidget($widget->id)) --}} @if(\Illuminate\Support\Facades\Gate::check('view-widget',[$widget->getServicesIdArray()])) {{-- @if(in_array($from, \App\Models\SplunkCache::$periods_allowed) && \App\Models\SplunkCache::getInfo($from, $widget->id, Auth::id())) @include('splunk_cache_code_generator.'.$widget->widget_type) @else--}} @include('code_generator.'.$widget->widget_type) {{--@endif--}} {{-- @elseif($widget->id==496) Костыль для виджета Cases_Activity_Histogram @include('code_generator.LINE_CHART_Cases_Activity_Histogram_NO_DATA') --}} @else @endif @endif @endif {{--@endif--}} @endforeach