PHP code example of cmsmaxinc / filament-system-versions

1. Go to this page and download the library: Download cmsmaxinc/filament-system-versions 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/ */

    

cmsmaxinc / filament-system-versions example snippets


use Cmsmaxinc\FilamentSystemVersions\FilamentSystemVersionsPlugin;
use Filament\Panel;

public function panel(Panel $panel): Panel
{
    return $panel
        // ... other configuration
        ->plugin(FilamentSystemVersionsPlugin::make());
}

return [
    'database' => [
        'table_name' => 'composer_versions',
    ],
    'widgets' => [
        'dependency' => [
            'show_direct_only' => true,
        ],
    ],
    'paths' => [
        'php_path' => env('PHP_PATH', ''),
        'composer_path' => env('COMPOSER_PATH', ''),
    ],
];

use Cmsmaxinc\FilamentSystemVersions\FilamentSystemVersionsPlugin;

public function panel(Panel $panel): Panel
{
    return $panel
        // ... other configuration
        ->plugin(
            FilamentSystemVersionsPlugin::make()
                ->navigationLabel('System Info')
                ->navigationGroup('Administration')
                ->navigationIcon('heroicon-o-cpu-chip') // Or use Enum
                ->navigationSort(10)
        );
}

use Cmsmaxinc\FilamentSystemVersions\Commands\CheckDependencyVersions;

// In your Console Kernel or service provider
Schedule::command(CheckDependencyVersions::class)->daily();

use Cmsmaxinc\FilamentSystemVersions\Filament\Widgets\DependencyWidget;

->widgets([
    DependencyWidget::class
])

use Cmsmaxinc\FilamentSystemVersions\Filament\Widgets\SystemInfoWidget;

->widgets([
    SystemInfoWidget::class
])

use Cmsmaxinc\FilamentSystemVersions\Filament\Widgets\DependencyStat;
use Filament\Widgets\StatsOverviewWidget as BaseWidget;

class CustomStats extends BaseWidget
{
    protected function getStats(): array
    {
        return [
            DependencyStat::make('Laravel')
                ->dependency('laravel/framework'),
            DependencyStat::make('FilamentPHP')
                ->dependency('filament/filament'),
            DependencyStat::make('Livewire')
                ->dependency('livewire/livewire'),
        ];
    }
}
bash
php artisan vendor:publish --tag="filament-system-versions-migrations"
php artisan migrate
bash
php artisan vendor:publish --tag="filament-system-versions-config"
bash
php artisan vendor:publish --tag="filament-system-versions-translations"
bash
php artisan dependency:versions
css
@source '../../../../vendor/cmsmaxinc/filament-system-versions/resources/**/*.blade.php';