@extends('admin.layouts.master-soyuz') @section('title', __('System Status | ')) @section('body') @component('admin.component.breadcumb',['secondactive' => 'active']) @slot('heading'){{ __('Help and support') }}@endslot @slot('menu2'){{ __('System Status') }}@endslot @endcomponent @php // Build a unified list of checks so we don't have a 600-line table. $checks = []; $servercheck = []; // PHP $phpVer = phpversion(); $phpOk = version_compare($phpVer, '7.4', '>='); $checks[] = ['group' => 'PHP', 'name' => 'PHP version', 'your' => $phpVer, 'required' => '7.4+', 'ok' => $phpOk, 'note' => $phpOk ? '' : 'Upgrade PHP to 7.4 or higher.']; $servercheck[] = $phpOk ? 1 : 0; // PHP extensions $exts = ['pdo','BCMath','openssl','fileinfo','json','session','gd','xml','tokenizer','standard','zip','mysqli','mbstring','ctype','exif']; foreach ($exts as $ext) { $loaded = extension_loaded($ext); $checks[] = ['group' => 'PHP Extensions', 'name' => $ext, 'your' => $loaded ? 'Enabled' : 'Disabled', 'required' => 'Yes', 'ok' => $loaded]; $servercheck[] = $loaded ? 1 : 0; } // INI $aufo = (bool) ini_get('allow_url_fopen'); $checks[] = ['group' => 'PHP Settings', 'name' => 'allow_url_fopen', 'your' => $aufo ? 'Enabled' : 'Disabled', 'required' => 'Yes', 'ok' => $aufo]; $servercheck[] = $aufo ? 1 : 0; $met = ini_get('max_execution_time'); $metOk = ($met == '-1' || (int) $met >= 300); $checks[] = ['group' => 'PHP Settings', 'name' => 'max_execution_time', 'your' => $met . ' sec', 'required' => '300 sec', 'ok' => $metOk]; $servercheck[] = $metOk ? 1 : 0; $iniBytes = function ($v) { if (preg_match('/^(\d+)(.)$/', $v, $m)) { if ($m[2] === 'G') return $m[1] * 1024 * 1024 * 1024; if ($m[2] === 'M') return $m[1] * 1024 * 1024; if ($m[2] === 'K') return $m[1] * 1024; } return (int) $v; }; foreach (['memory_limit', 'upload_max_filesize', 'post_max_size'] as $k) { $val = ini_get($k); $bytes = $iniBytes($val); $ok = ($val == '-1' || $bytes >= 1024 * 1024 * 1024); $checks[] = ['group' => 'PHP Settings', 'name' => $k, 'your' => $val, 'required' => '1G', 'ok' => $ok]; $servercheck[] = $ok ? 1 : 0; } // Writable directories $paths = [ 'storage/' => storage_path(), 'bootstrap/cache' => base_path('bootstrap/cache'), 'storage/framework/sessions' => storage_path('framework/sessions'), ]; foreach ($paths as $label => $path) { $w = is_writable($path); $checks[] = ['group' => 'Filesystem', 'name' => $label . ' is writable?', 'your' => $w ? 'Writable' : 'Non-Writable', 'required' => 'Yes', 'ok' => $w, 'note' => $path]; $servercheck[] = $w ? 1 : 0; } // Database $dbInfo = []; try { $results = DB::select('SHOW VARIABLES LIKE "%version%"'); foreach ($results as $r) { if (in_array($r->Variable_name, ['version','version_comment'])) { $dbInfo[$r->Variable_name] = $r->Value; } } } catch (\Throwable $e) {} $mysqlVer = $dbInfo['version'] ?? '—'; $mysqlOk = version_compare($mysqlVer, '5.7', '>='); array_unshift($checks, ['group' => 'Database', 'name' => 'MySQL Version', 'your' => $mysqlVer, 'required' => '5.7+', 'ok' => $mysqlOk]); if (!empty($dbInfo['version_comment'])) { array_splice($checks, 1, 0, [['group' => 'Database', 'name' => 'Server Type', 'your' => $dbInfo['version_comment'], 'required' => '—', 'ok' => true]]); } $servercheck[] = $mysqlOk ? 1 : 0; // Laravel itself array_unshift($checks, ['group' => 'Framework', 'name' => 'Laravel Version', 'your' => App::version(), 'required' => '—', 'ok' => true]); $passed = count(array_filter($servercheck, fn($x) => $x === 1)); $total = count($servercheck); $allGood = !in_array(0, $servercheck, true); // Group checks $grouped = []; foreach ($checks as $c) { $grouped[$c['group']][] = $c; } $groupIcons = [ 'Framework' => ['icon' => 'fa-bolt', 'color' => '#3b6df0', 'bg' => '#dbeafe'], 'Database' => ['icon' => 'fa-database', 'color' => '#06b6d4', 'bg' => '#cffafe'], 'PHP' => ['icon' => 'fa-code', 'color' => '#8b5cf6', 'bg' => '#ede9fe'], 'PHP Extensions' => ['icon' => 'fa-puzzle-piece', 'color' => '#f59e0b', 'bg' => '#fef3c7'], 'PHP Settings' => ['icon' => 'fa-sliders', 'color' => '#a855f7', 'bg' => '#f3e8ff'], 'Filesystem' => ['icon' => 'fa-folder-open', 'color' => '#16a34a', 'bg' => '#dcfce7'], ]; @endphp
@endsection