PHP code example of duyld2108 / laravel-file-manager
1. Go to this page and download the library: Download duyld2108/laravel-file-manager 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/ */
duyld2108 / laravel-file-manager example snippets
'image_optimization' => [
// Enable or disable auto optimization on upload
'enabled' => true,
// Target format: 'webp', 'avif', 'jpg', 'png', or null (keep original format)
'format' => 'webp',
// Quality for lossy formats (1 - 100)
'quality' => 85,
// Maximum dimensions in pixels (proportional scaleDown)
'max_width' => 2048,
'max_height' => 2048,
// Keep original file if the converted version is larger
'keep_original_when_larger' => true,
// Supported raster mimetypes
'mimetypes' => [
'image/jpeg',
'image/pjpeg',
'image/png',
'image/webp',
'image/bmp',
],
],
'thumbnails' => [
// Cache thumbnails on disk to avoid repeating on-the-fly image operations
'cache_on_disk' => true,
// Hidden directory name for cached thumbnails
'thumb_folder' => '.thumbs',
// Thumbnail dimensions (pixels)
'width' => 120,
'height' => 120,
],
// Route prefix (default: /file-manager)
'routePrefix' => 'file-manager',
// Disk names from config/filesystems.php accessible in file manager
'diskList' => ['public'],
// Window layout: 1 = Single window, 2 = Window with directory tree, 3 = Two windows
'windowsConfig' => 2,
// Middleware applied to file manager routes
'middleware' => ['web', 'auth'],
use Duyld2108\LaravelFileManager\Services\ConfigService\DefaultConfigRepository;
use Duyld2108\LaravelFileManager\Services\ACLService\ConfigACLRepository;