ezsystems/ez-support-tools
Laravel support toolkit for debugging and maintenance: inspect app and environment details, run health checks, gather logs/config snapshots, and expose helpful artisan commands to speed up troubleshooting in production and local setups.
Installation Add the bundle via Composer:
composer require ezsystems/ez-support-tools
Enable the bundle in config/app.php under providers:
EzSystems\EzSupportToolsBundle\EzSupportToolsBundle::class,
First Use Case: System Information Access system details via the CLI command:
php bin/console ez-support-tools:system-info
This generates a JSON/HTML report of:
Where to Look First
vendor/bin/console list ez-support-tools (for available commands).config/packages/ez_support_tools.yaml (if present).templates/ez_support_tools/ (for customizing output).Debugging Environment Issues
ez-support-tools:system-info to compare dev/staging/prod environments.php bin/console ez-support-tools:system-info --format=json | jq '.php.extensions'
Automated Reporting
# .github/workflows/test.yml
jobs:
test:
runs-on: ubuntu-latest
steps:
- run: php bin/console ez-support-tools:system-info > system_report.json
- uses: actions/upload-artifact@v3
with:
name: system-report
path: system_report.json
Customizing Output
templates/ez_support_tools/system_info.html.twig).EzSystems\EzSupportToolsBundle\Collector\CollectorInterface:
// src/Collector/CustomCollector.php
namespace App\Collector;
use EzSystems\EzSupportToolsBundle\Collector\CollectorInterface;
class CustomCollector implements CollectorInterface {
public function collect(): array {
return ['custom_key' => 'custom_value'];
}
}
services.yaml:
services:
App\Collector\CustomCollector:
tags: ['ez_support_tools.collector']
API-Driven Debugging
JsonResponse):
// src/Controller/SystemInfoController.php
use EzSystems\EzSupportToolsBundle\Collector\CollectorManager;
class SystemInfoController extends AbstractController {
public function __invoke(CollectorManager $collectorManager): JsonResponse {
return new JsonResponse($collectorManager->collect());
}
}
config/routes.yaml:
ez_support_tools.api:
path: /_support/system-info
controller: App\Controller\SystemInfoController
Sensitive Data Exposure
--exclude-sensitive flag or override the SensitiveDataCollector to redact fields:
// src/Collector/SensitiveDataCollector.php
namespace App\Collector;
use EzSystems\EzSupportToolsBundle\Collector\SensitiveDataCollector as BaseCollector;
class SensitiveDataCollector extends BaseCollector {
protected function getSensitiveKeys(): array {
return array_merge(parent::getSensitiveKeys(), ['db_password']);
}
}
Performance Overhead
--collectors to specify only critical ones:
php bin/console ez-support-tools:system-info --collectors=php,os
Template Caching
php bin/console cache:clear
Dependency Conflicts
ezsystems/* packages if versions are mismatched.composer.json:
"require": {
"ezsystems/ez-support-tools": "^1.0",
"ezsystems/platform": "^1.0"
}
Log Collectors Enable debug mode to log collector output:
php bin/console debug:config ez_support_tools | grep collectors
Validate JSON Output
Use jq to validate JSON structure:
php bin/console ez-support-tools:system-info --format=json | jq .
Check for Deprecated Methods Run static analysis tools like PHPStan to catch deprecated API usage:
vendor/bin/phpstan analyse src --level=5
Custom Collectors
CollectorInterface and tag as ez_support_tools.collector (as shown above).RedisCollector for Redis server details.Hook into Commands
Extend existing commands by overriding them (e.g., SystemInfoCommand):
// src/Command/CustomSystemInfoCommand.php
namespace App\Command;
use EzSystems\EzSupportToolsBundle\Command\SystemInfoCommand;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
class CustomSystemInfoCommand extends SystemInfoCommand {
protected function execute(InputInterface $input, OutputInterface $output): int {
// Custom logic before/after parent execution
return parent::execute($input, $output);
}
}
Register the command in services.yaml:
services:
App\Command\CustomSystemInfoCommand:
tags: ['console.command']
arguments:
$collectorManager: '@ez_support_tools.collector_manager'
decorates: 'ez_support_tools.system_info'
Event Listeners
Listen for ez_support_tools.collect events to modify data dynamically:
// src/EventListener/CustomCollectorListener.php
namespace App\EventListener;
use EzSystems\EzSupportToolsBundle\Event\CollectEvent;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
class CustomCollectorListener implements EventSubscriberInterface {
public static function getSubscribedEvents(): array {
return [
CollectEvent::NAME => 'onCollect',
];
}
public function onCollect(CollectEvent $event): void {
$event->addData(['custom_metric' => microtime(true)]);
}
}
How can I help you explore Laravel packages today?