opensid/laravel-filemanager
Laravel file manager package for browsing, uploading, and managing files and images through a ready-made UI. Integrates with Laravel apps to handle storage, previews, and common file operations, useful for adding an admin-friendly media browser without building one from scratch.
composer require opensid/laravel-filemanager:^1.1 (or the package's distribution name in your project) and publish its config and assets. The publish tags are worth checking in the repo README the first time — they are the thing most likely to differ between forks.php artisan vendor:publish --tag=<package>_config) and open it before writing any code. This is where the accepted extensions, upload size limit, storage disk, per-user base directory, and the content-validation toggle live. Almost every "the package is doing something weird" issue is really a config default.fileinfo extension (the magic-byte checks depend on it), gd or imagick for thumbnail generation, and a configured filesystem disk (usually public with php artisan storage:link).web; add auth (or your own gate) so uploads aren't anonymously writable..php. In v1.1.0 the image must pass and the renamed file must be rejected with a readable wrong extension / size message. If you see the literal string "...maximale size of %d MB.", your translations are stale — that bug is fixed in this release.FileContentValidator class for the signature table, (3) the package's resources/lang / lang/vendor files for the message keys (max_size_reached, wrong_extension), (4) your config/filesystems.php disk definition.type=image (or type=file) query parameter and expect a JSON response containing the file location. This is where you'll spend most integration time — return shapes differ between editor versions.postMessage hook to hand the selected path back to your form. Keep the iframe on the same origin.auth()->id().FileContentValidator is useful as a general Laravel validation rule for any upload endpoint, not just the file manager. That gives you consistent magic-byte enforcement across ProfileController, DocumentController, etc., without duplicating signature tables..webm, .heic), add it in two places: the config's extension allow-list and a signature entry in the validator. Adding only the extension re-opens the exact spoofing hole the validator exists to close.Storage::fake('public') with UploadedFile::fake()->image(...) for the happy path, and commit a small binary fixture for the rejection path (a real JPEG containing a <?php fragment). Since v1.1.0 specifically fixed false rejections on high-entropy images, keep a real screenshot fixture in the suite so future signature changes don't regress it.<?= and bare <? detection so random compressed image bytes no longer trip it, but a determined attacker can still craft a payload the scanner misses. The validator is defense in depth — also make sure the upload directory can't execute PHP (php_flag engine off, or store on a non-executing disk/S3).fileinfo magic database = false rejections. If valid images suddenly fail after a server migration, check php -i | grep fileinfo and the system magic file before blaming the package.iso at byte 32769) and negative offsets from EOF (the koly trailer on dmg). These work on local temp files but can break on streamed or S3-backed uploads where the temp file isn't a real path. If you use a remote disk, make sure the upload is materialized locally first.iso/dmg? Each new signature widens the accepted surface. For a typical CMS or intranet, removing exotic types from the allow-list is a cheaper win than relying on signature checks.:size, not %d. The v1.1.0 fix means the max_size_reached translation now interpolates Laravel-style placeholders, and the controller passes the configured max_upload_size. If you've overridden the language file with the old %d text, you'll reintroduce the bug — update your published translations after upgrading.max_upload_size may be larger than upload_max_filesize/post_max_size in php.ini; oversized requests then fail with an opaque UPLOAD_ERR_INI_SIZE before the package's own message ever shows. Keep the two in sync, or users see a generic error.php artisan config:clear (and view:clear after touching assets). Silent config caching is the most common reason a setting "doesn't work"... and null bytes, and don't trust the client-supplied extension even after validation — derive the stored name server-side.composer update, re-check any published language files, and re-run your upload tests — particularly the image-upload path, which is what the release was mainly fixing.How can I help you explore Laravel packages today?