Weave Code
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

Dropzone Laravel Package

contao-components/dropzone

Contao Dropzone integration component providing drag-and-drop file uploads for Contao CMS. Bundles Dropzone assets and configuration hooks to quickly add modern upload widgets to backend or frontend forms with minimal setup.

View on GitHub
Deep Wiki
Context7

DropZone integration for Contao Open Source CMS

Frequently asked questions about Dropzone
Can I use contao-components/dropzone in a pure Laravel project without Contao CMS?
No, this package is specifically designed for Contao CMS and assumes Contao’s architecture (DCA, TL_* tables). For Laravel-only projects, consider alternatives like Laravel Filemanager or Dropzone.js with custom Laravel storage integration. You’d need to refactor Contao-specific logic to fit Laravel’s ecosystem.
How do I install this package in a Laravel + Contao hybrid app?
Run `composer require contao-components/dropzone` in your project. Ensure Contao’s autoloader is configured in Laravel’s `composer.json` (e.g., via `contrib` or `repositories`). Then, enqueue Dropzone assets using Laravel Mix or Vite, and adapt Contao’s DCA-based file handling to Laravel’s Storage facade or Eloquent models.
Will this work with Laravel’s CSRF protection?
No, Dropzone.js uploads may bypass Laravel’s default CSRF protection. You’ll need to manually add a CSRF token to your upload forms (e.g., via a meta field or custom middleware) or use Laravel’s `@csrf` directive in your frontend templates. Alternatively, configure Dropzone to include the token in AJAX requests.
Can I use Laravel’s Storage facade (e.g., S3, local) with this package?
Not out-of-the-box—the package defaults to Contao’s storage system. You’ll need to override the file upload logic to use Laravel’s Storage facade. This involves modifying the package’s file handlers or creating a custom wrapper to bridge Contao’s uploads/ directory with Laravel’s storage paths.
Does this package support file validation like Laravel’s Form Requests?
No, validation relies on Contao’s DCA rules. To integrate with Laravel, you’ll need to duplicate validation logic in Laravel’s Form Requests or Validator and ensure consistency between Contao’s backend rules and Laravel’s frontend validation. This may require custom middleware or a hybrid validation layer.
How do I handle errors in Dropzone uploads for a Laravel API response?
Contao’s error responses (e.g., TL_ERROR) won’t match Laravel’s JSON format. You’ll need to create a custom error handler that translates Contao errors into Laravel-compatible JSON responses. This can be done via middleware or by overriding Dropzone’s error callbacks to return API-friendly messages.
Is this package compatible with Laravel 10 and newer?
The package itself doesn’t enforce Laravel version constraints, but its Contao dependencies may not align with Laravel’s latest features. Test thoroughly for compatibility with Laravel’s asset pipelines (e.g., Vite), routing, and middleware. If using Contao 4.x, ensure it’s compatible with your Laravel version.
Can I use this for frontend-only file uploads in Laravel without Contao?
Yes, but you’d need to strip out Contao-specific dependencies. Focus on the Dropzone.js frontend integration (CSS/JS assets) and manually handle file processing in Laravel’s controllers using the Storage facade. Skip Contao’s DCA and database logic entirely for a Laravel-native solution.
Are there alternatives to this package for Laravel file uploads?
For Laravel-only projects, consider packages like `intervention/image` (for image processing), `laravel-filemanager` (for media libraries), or standalone Dropzone.js with custom Laravel backend logic. These avoid Contao’s dependencies and integrate natively with Laravel’s ecosystem.
How do I test Dropzone uploads in a Laravel + Contao environment?
Test both frontend and backend layers. Use Laravel’s testing tools (e.g., HTTP tests) to simulate Dropzone AJAX requests and verify file storage, validation, and error responses. For Contao-specific logic, use Contao’s testing utilities or mock Contao’s DCA models. Expect higher maintenance due to dual-system dependencies.
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.
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle
atriumphp/atrium
sandermuller/package-boost-laravel
sandermuller/boost-skills
redaxo/core
yusufgenc/filament-api-forge
l3aro/rating-star-for-filament
leek/filament-subtenant-scope