hasAccess(Auth::user())->with('device')->orderBy('app_type')->get()->groupBy('app_type') as $type => $groupedApps) { echo '
'; echo '

'.generate_link($groupedApps->first()->displayName(), array('page' => 'apps', 'app' => $type)).'

'; /** @var \Illuminate\Support\Collection $groupedApps */ $groupedApps = $groupedApps->sortBy(function ($app) { return $app->device->hostname; }); /** @var Application $app */ foreach ($groupedApps as $app) { $graph_type = $graphs[$app->app_type][0]; $graph_array['type'] = 'application_'.$app->app_type.'_'.$graph_type; $graph_array['id'] = $app->app_id; $graph_array_zoom['type'] = 'application_'.$app->app_type.'_'.$graph_type; $graph_array_zoom['id'] = $app->app_id; $link_array = $graph_array; $link_array['page'] = 'device'; $link_array['device'] = $app->device_id; $link_array['tab'] = 'apps'; $link_array['app'] = $app->app_type; unset($link_array['height'], $link_array['width']); $overlib_url = generate_url($link_array); $overlib_link = ''.optional($app->device)->shortDisplayName().''; if (!empty($app->app_instance)) { $overlib_link .= ''.$app->app_instance.''; $content_add = '('.$app->app_instance.')'; } $overlib_link .= '
'; $overlib_link .= generate_graph_tag($graph_array); $overlib_content = generate_overlib_content($graph_array, optional($app->device)->displayName().' - '.$app->app_type.$content_add); echo "
"; echo overlib_link($overlib_url, $overlib_link, $overlib_content); echo '
'; }//end foreach echo '
'; }//end foreach