Файл: app/Http/Controllers/Admin/AdminController.php
Строк: 52
<?php
declare(strict_types=1);
namespace AppHttpControllersAdmin;
use AppHttpControllersController;
use AppModelsUser;
use IlluminateSupportFacadesArtisan;
use IlluminateViewView;
class AdminController extends Controller
{
/**
* Главная страница
*/
public function main(): View
{
$existBoss = User::query()
->where('level', User::BOSS)
->count();
return view('admin/index', compact('existBoss'));
}
/**
* Проверка обновлений
*/
public function upgrade(): View
{
Artisan::call('migrate', ['--force' => true]);
$output = Artisan::output();
return view('admin/upgrade', compact('output'));
}
/**
* Просмотр информации о PHP
*/
public function phpinfo(): View
{
if (! isAdmin(User::ADMIN)) {
abort(403, __('errors.forbidden'));
}
$iniInfo = null;
if (function_exists('ini_get_all')) {
$iniInfo = ini_get_all();
}
if ($gdInfo = gd_info()) {
$gdInfo = parseVersion($gdInfo['GD Version']);
}
return view('admin/phpinfo', compact('iniInfo', 'gdInfo'));
}
}