1. Go to this page and download the library: Download laragems/os-info library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
laragems / os-info example snippets
aragems\OsInfo\OsInfo;
use Laragems\OsInfo\Platform;
$info = OsInfo::detect();
echo $info->name(); // Ubuntu, macOS, Microsoft Windows 11 Pro
echo $info->platform()->value; // linux, macos, windows
echo $info->architecture(); // x86_64, arm64, x86
echo $info->memory()->totalBytes();
echo $info->cpu()->logicalCores();
echo $info->runtime()->currentUser();
if ($info->platform() === Platform::Linux) {
echo 'Running on Linux';
}