@php
    $widget = \App\Models\SplunkSearches::where('id',$id)->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)
        @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--}}
            @else
               {{-- 
                --}}
               
            @endif
        {{--@endif--}}
    @endif
@endif