filament-browser
File & Folders & Media Browser With Code Editor
يمتدّ من filament
composer require tomatophp/filament-browser- browser
- filament-plugin
- file
- file-browser
- manager
اقرأني

Filament File Browser
File & Folders & Media Browser With Code Editor
[!CAUTION] This package gives access to files on your server. Use it for super-admins only, keep the developer gate on, and point
basePath()at the smallest folder you need.
Screenshots


Version Compatibility
| Plugin | Filament | Laravel | PHP |
|---|---|---|---|
| 5.x | 5.x | 12.x / 13.x | 8.2+ |
| 1.x / 2.x (v3 branch) | 3.x | 10.x / 11.x | 8.1+ |
Installation
after install your package please run this command
finally register the plugin on /app/Providers/Filament/AdminPanelProvider.php
The page is available at /admin/browser (under the Settings navigation group).
Options
| Method | Default | Description |
|---|---|---|
basePath(string $path) | config('filament-browser.start_path') (base_path()) | Root folder. Every operation is confined to it. |
allowCreateNewFile(bool = true) | false | Create code and markdown files. |
allowCreateFolder(bool = true) | false | Create folders. |
allowUpload(bool = true) | false | Upload files into the current folder. |
allowEditFile(bool = true) | false | Save changes from the code / markdown editor (read-only otherwise). |
allowRenameFile(bool = true) | false | Rename files. |
allowDeleteFile(bool = true) | false | Delete files. |
allowPreview(bool = true) | true | Preview images, video, audio, PDF and spreadsheets. |
hiddenFiles(array) / hiddenFolders(array) | [] | Absolute paths that are not listed and cannot be opened. |
hiddenExtensions(array) | [] | Extensions that are not listed, opened or created (e.g. ['php']). |
hideEnvFiles(bool = true) | true | .env and .env.* are hidden; call hideEnvFiles(false) to show them. |
developerGate(bool = true) | true | Protect the page with filament-developer-gate. |
authorize(bool|Closure) | true | Who may open the page, e.g. fn () => auth()->user()->hasRole('super_admin'). |
allowCode() and allowMarkdown() are kept for backward compatibility and have no effect.
Developer Gate
The browser asks for the developer password before it opens. The default password is password; change it in your .env:
Security
- Every path sent from the browser is relative to
basePath(), resolved withrealpath()and refused when it leaves the root (.., absolute paths, symlinks pointing outside), or when it is hidden. .envfiles are hidden by default, and hidden files, folders and extensions can not be opened, created or renamed to.- Nothing can be written unless you enable the matching
allow*()option, and the checks run again on the server when the action runs. - Previews are embedded in the page; files are never copied to public storage.
- The developer gate is checked on every Livewire request, not only on the page route.
- Do not point
basePath()at a folder served by your web server (such aspublic/) whileallowCreateNewFile()orallowUpload()is enabled, or hide thephpextension.
Publish Assets
you can publish config file by use this command
you can publish views file by use this command
you can publish languages file by use this command
Testing
Other Filament Packages
Checkout our Awesome TomatoPHP