PHP code example of filaforge / filament-system-packages

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

    

filaforge / filament-system-packages example snippets


use Filament\Panel;

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

// config/system-packages.php
return [
    'enabled' => env('SYSTEM_PACKAGES_ENABLED', true),
    'package_manager' => env('SYSTEM_PACKAGES_MANAGER', 'auto'),
    'update_check_interval' => env('SYSTEM_PACKAGES_UPDATE_INTERVAL', 3600),
    'auto_update' => env('SYSTEM_PACKAGES_AUTO_UPDATE', false),
    'security_updates_only' => env('SYSTEM_PACKAGES_SECURITY_ONLY', true),
    'allowed_packages' => [
        'nginx', 'apache2', 'mysql-server', 'php', 'composer',
        'git', 'nodejs', 'npm', 'docker', 'redis-server'
    ],
    'blocked_packages' => [
        'unattended-upgrades', 'snapd', 'flatpak'
    ],
    'repositories' => [
        'main' => true,
        'universe' => true,
        'multiverse' => false,
        'restricted' => false,
    ],
];

// remove ->plugin(\Filaforge\SystemPackages\SystemPackagesPlugin::make())
bash
# Publish provider groups (config, views, migrations)
php artisan vendor:publish --provider="Filaforge\\SystemPackages\\Providers\\SystemPackagesServiceProvider"

# Run migrations
php artisan migrate
bash
php artisan optimize:clear
bash
composer remove filaforge/system-packages
php artisan optimize:clear