Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Multiple File Upload Bundle Laravel Package

meloflavio/multiple-file-upload-bundle

Meloflavio's MultipleFileUploadBundle is a PHP package that simplifies adding multiple-file upload support to web applications. It provides bundle-style integration for managing multi-file selection and upload handling, helping developers implement bulk file upload workflows with less boilerplate.

View on GitHub
Deep Wiki
Context7

Getting Started

  • Install with Composer: composer require <vendor>/<package> (check Packagist for exact name). Publish config and assets: php artisan vendor:publish --provider="<Vendor>\<Package>\<PackageServiceProvider>".
  • Include Dropzone assets in your layout or use the package’s Blade component/directive if provided. Ensure CSRF token is available for uploads.
  • First use case: a single-file image upload form. Add the Dropzone container, point it at the package route or your controller endpoint, and use Laravel validation rules (image, max:2048, etc.) on the server.
  • Start with the package README and config/<package>.php. Check routes (php artisan route:list) and the default upload controller/request classes. For v1.3.1, the new click event is the quickest way to make the dropzone open a file picker on click; the pt_BR translation can be published/selected if you need Brazilian Portuguese UI strings.

Implementation Patterns

  • Single dropzone per form: bind the package’s JS initializer after the DOM is ready, set url, headers: { 'X-CSRF-TOKEN': ... }, and let the package handle the upload lifecycle. Use Laravel request validation and return JSON with the stored path/URL.
  • Multiple independent dropzones: initialize each container separately, use distinct paramName values or hidden inputs, and namespace event handlers. The v1.3.1 click event is useful when you want custom click behavior (e.g., trigger a modal or a separate file input) rather than the default Dropzone click-to-browse.
  • Event-driven UI: hook into addedfile, success, error, queuecomplete, and the new click event to update previews, progress bars, and form state. Keep server responses consistent ({ success, file: { url, name, size } }) so front-end handlers stay simple.
  • Localization: publish translations and set the app locale to pt_BR (or pass the locale to the JS initializer) to use the new Brazilian Portuguese strings. This is especially useful for multi-locale admin panels.
  • Server-side integration: store uploads via Laravel’s filesystem (Storage::disk('public')->putFile(...)), validate MIME/size, and optionally create model attachments in a transaction. For large files, use chunked uploads if the package supports them, or configure Dropzone’s chunking option and a matching chunk endpoint.
  • Testing: use Storage::fake() and UploadedFile::fake() in feature tests. For JS behavior, use Dusk or a lightweight browser test to confirm the new click event fires and the dropzone opens correctly.

Gotchas and Tips

  • CSRF and session expiry: Dropzone uploads bypass normal form submission; ensure the CSRF token is current and handle 419 responses gracefully. Refresh the token on long-lived pages.
  • Auto-discovery conflicts: Dropzone’s autoDiscover can attach to elements unintentionally. Disable it globally and initialize only the containers you control, especially when using the package’s click event.
  • Click event ordering: The v1.3.1 click event may fire alongside Dropzone’s default click behavior. If you need custom behavior, call preventDefault()/stop propagation carefully and test with keyboard accessibility in mind.
  • Translation publishing: pt_BR strings only apply after publishing/loading the translation files and setting the locale correctly. Clear config/view caches (php artisan optimize:clear) after publishing.
  • Validation mismatches: Client-side acceptedFiles/maxFilesize are UX hints only. Always enforce MIME, size, and count rules server-side; return structured JSON errors so Dropzone can display them.
  • Config caching: If you change package config in production, run php artisan config:cache. Route and event changes may require route:clear/event:clear during debugging.
  • Extension points: Prefer publishing the package’s config, views, and translations over editing vendor files. For custom upload handling, extend the package’s request/controller or listen to its events rather than forking. The new click event and translation are safe additive changes, so v1.3.1 should be a drop-in upgrade; still run your upload feature tests after updating.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
frankyso/ipaymu
3mdikram/worldmoneywords
snowsoft/config
itmosoft/laravel-subscriptions
larva/laravel-ai-qwen
diephp/sequences
users-au/socialite-provider
twidpay/twid-logger
mrnewport/laravel-plaid
mrnewport/laravel-repo
mrnewport/laravel-docsign
mrnewport/laravel-stow
mrnewport/laravel-flow
mrnewport/laravel-priceable
mrnewport/laravel-nestedterms
fredmeng/laravel-apidoc-generator
itstructure/laravel-multilingual-tools
pdustdar/elasticsearch
markupai/php-sdk
rlacerda83/lumem-microservice-shipment