jasekz/laradrop
Laradrop is a Laravel package that integrates Dropzone.js to add drag-and-drop file uploads. It handles server-side upload processing, validation, storage, and deletion, with configurable options and views for quickly adding file uploads to your app.
composer require jasekz/laradrop
Jasekz\Laradrop\LaradropServiceProvider::class to config/app.php.php artisan vendor:publish --provider="Jasekz\Laradrop\LaradropServiceProvider"
php artisan storage:link
config/laradrop.php and set the upload path, allowed extensions, max file size, and route prefix. Confirm the registered routes with:
php artisan route:list | grep laradrop
/laradrop) in a logged-in session. You should see the Dropzone-based file manager.First use case: blog post attachments. Embed the manager inside an admin form, upload an image, copy the returned storage path, save it to your Post model, and render it with Storage::url($path) on the front end.
<iframe> inside your admin form and use postMessage or a small inline JS listener to push the selected file path back to the parent form. This keeps the package’s UI untouched while giving you a "browse files" button.media table so multiple models can reference the same asset.path, original_name, mime, size, and a polymorphic attachable_id/type. Query with Storage::disk(...)->url() at render time rather than storing absolute URLs.auth (and your role check) instead of relying on defaults:
Route::middleware(['auth', 'can:manage-media'])->group(function () {
// laradrop routes or your wrapper view
});
avatars/ vs documents/), either add a query parameter your wrapper controller interprets, or register a second controller with a distinct config array passed at runtime.X-CSRF-TOKEN from a <meta> tag. A 419 in the network tab almost always means a missing token, not an auth bug.storage/app (or whatever path is configured). A 500 on upload with no Laravel exception is usually a permission or missing directory issue.composer update. Re-publish with --force and clear your browser cache; the bundled Dropzone version is old and will conflict if your app already loads Dropzone globally.storage:link for URLs. Files stored under storage/app/public are not web-accessible until the symlink exists. Persist relative paths, not absolute URLs, so you can move disks later.config/laradrop.php run php artisan config:clear. A surprising number of "my config change did nothing" reports trace back to a cached config.php artisan route:list after install and confirm no prefix clash with your own /laradrop or /files endpoints.vendor/ — changes vanish on composer update.upload_max_filesize/post_max_size), 419 (CSRF), 422 (validation config), or 500 (permissions/logs). Check storage/logs/laravel.log for the exception trace before assuming the package is broken.How can I help you explore Laravel packages today?