flobbos/laravel-system-info
最新稳定版本:1.0.2
Composer 安装命令:
composer require flobbos/laravel-system-info
包简介
Minimalist package to expose Laravel system info via API
README 文档
README
A minimalist Laravel package to expose system information (Laravel version, PHP version, installed packages, and outdated packages) via a secure API endpoint. This package is designed to allow centralized monitoring of Laravel sites. It uses its own token-based authentication middleware, independent of Sanctum or other auth systems.
The package supports Laravel 9+ for the moment.
Installation
-
Require the package via Composer:
composer require flobbos/laravel-system-info -
Install the package (generates a token and publishes config):
php artisan laravel-system-info:installThis will add
SYSTEM_INFO_TOKEN=your-generated-tokento your .env file and publishconfig/laravel-system-info.php. Copy the token to your ServerSync dashboard for API authentication.
Usage
-
The package adds a
/api/system-infoendpoint, protected by the generated token. -
Fetch info with a GET request using Bearer auth:
curl -H "Authorization: Bearer your-token" https://your-laravel-site.com/api/system-info -
Response example:
{ "laravel_version": "11.0.0", "php_version": "8.3.1", "installed_packages": [ { "name": "laravel/framework", "version": "11.0.0" // ... other packages } ], "outdated_packages": [ { "name": "some/package", "version": "1.0.0", "latest": "1.1.0" } ] } -
You can use this endpoint to fetch and display info for Laravel sites.
Configuration
-
config/laravel-system-info.php:<?php return [ 'token' => env('SYSTEM_INFO_TOKEN', null), ];
-
Regenerate token if needed by rerunning the install command.
Security
- The endpoint is protected by a custom middleware checking the Bearer token from .env.
- Ensure
APP_DEBUG=falsein production to avoid exposing sensitive info on errors. - The package doesn't access .env variables; it only runs Composer commands for package info.
Compatibility
- Laravel 9.0 and above.
License
MIT License. See LICENSE for more information.
统计信息
- 总下载量: 10
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-09-23
