@php $allModules = Module::all(); $activeModules = []; function moveUniversalToFront($array, $keyword = 'Universal') { // Find the index of the item with the specified keyword in the product_name $index = array_search(true, array_map(function ($item) use ($keyword) { return stripos($item['product_name'], $keyword) !== false; }, $array)); // If the item is found, move it to the first position if ($index !== false) { $item = $array[$index]; unset($array[$index]); array_unshift($array, $item); } return $array; } $universal = false; foreach ($allModules as $module) { $config = require base_path() . '/Modules/' . $module . '/Config/config.php'; if(isset($config['envato_item_id']) && $config['envato_item_id']!== ''){ if(stripos($config['name'], 'universal') !== false){ $universal = true; break; } $activeModules[] = $config['envato_item_id']; } } $notInstalledModules = []; if(!$universal){ $plugins = \Froiden\Envato\Functions\EnvatoUpdate::plugins(); if (empty($plugins)) { $plugins = []; }else{ $plugins = moveUniversalToFront($plugins); } foreach ($plugins as $item) { if (!in_array($item['envato_id'], $activeModules)) { $notInstalledModules[] = $item; } } } @endphp @if (count($notInstalledModules) && !$universal)

{{ str(config('froiden_envato.envato_product_name'))->replace('new', '')->headline() }} Official Modules

@foreach ($notInstalledModules as $item)
@if(isset($item['rating']))
{{number_format($item['rating'],1)??0}} {{$item['number_of_sales']??0}} Sales @endif
{{ $item['product_name'] }}

{{ $item['summary'] }}

@endforeach
@endif