PHP code example of jakovic / laravel-storage-explorer
1. Go to this page and download the library: Download jakovic/laravel-storage-explorer 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/ */
jakovic / laravel-storage-explorer example snippets
return [
// Which filesystem disk to browse (must exist in config/filesystems.php)
'disk' => 'local',
// Subdirectory within the disk to use as root (empty = disk root)
'root_path' => '',
// Standalone route settings
'standalone' => [
'enabled' => true,
'prefix' => 'storage-explorer',
'middleware' => ['web'],
],
// Embedded mode: render inside your app's layout
'layout' => null, // e.g. 'layouts.admin'
'content_section' => 'content', // @section name in your layout
'page_title' => 'Storage Explorer',
// Files hidden from the tree view
'hidden_patterns' => ['.gitignore', '.gitkeep', '.DS_Store'],
// File preview settings
'preview' => [
'max_size' => 2 * 1024 * 1024, // 2 MB (full preview limit)
'tail_size' => 64 * 1024, // 64 KB (tail preview for large files)
'max_lines' => 1000,
'text_extensions' => ['txt', 'log', 'md', 'csv', 'json', 'xml', 'yml', ...],
'image_extensions' => ['jpg', 'jpeg', 'png', 'gif', 'svg', 'webp', ...],
'code_extensions' => ['php', 'js', 'ts', 'css', 'py', 'go', 'rs', ...],
],
// Upload settings
'upload' => [
'enabled' => true,
'max_size' => 10240, // KB
'blocked_extensions' => ['php', 'phar', 'sh', 'exe', 'bat', 'cmd', 'com', 'msi'],
],
// Delete settings
'delete' => [
'enabled' => true,
'allow_directory_delete' => false,
],
// Tree display
'tree' => [
'lazy_load' => true,
'max_depth' => 20,
'max_items_per_directory' => 500,
],
];