PHP code example of mydnic / filament-file-browser

1. Go to this page and download the library: Download mydnic/filament-file-browser 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/ */

    

mydnic / filament-file-browser example snippets


use Mydnic\FilamentFileBrowser\FilamentFileBrowserPlugin;

public function panel(Panel $panel): Panel
{
    return $panel
        // ... other configuration
        ->plugins([
            FilamentFileBrowserPlugin::make(),
        ]);
}

return [
    // The default disk to use when the file browser is first loaded
    'default_disk' => 'public',

    // Navigation settings
    'navigation_group' => 'Files',
    'navigation_sort' => 0,

    // Temporary directory for zip downloads
    'temp_directory' => storage_path('app/temp'),

    // Maximum upload file size in MB
    'max_upload_size' => 10,

    // Allowed file extensions for upload (empty array means all extensions are allowed)
    'allowed_extensions' => [],

    // Disks to show in the file browser (empty array means all disks are shown)
    'disks' => [],
];

'disks' => [
    's3' => [
        'driver' => 's3',
        'key' => env('AWS_ACCESS_KEY_ID'),
        'secret' => env('AWS_SECRET_ACCESS_KEY'),
        'region' => env('AWS_DEFAULT_REGION'),
        'bucket' => env('AWS_BUCKET'),
        'url' => env('AWS_URL'),
        'endpoint' => env('AWS_ENDPOINT'),
        'use_path_style_endpoint' => env('AWS_USE_PATH_STYLE_ENDPOINT', false),
    ],
],
bash
php artisan vendor:publish --tag="filament-file-browser-config"