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' => [],
];