File manager using Dropzone.js for Laravel 5 - PHP
Branch: dev
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
src/Jasekz/Laradrop Added support for file type validations Nov 13, 2018
.gitignore Init Aug 16, 2015
LICENSE Init Aug 16, 2015 Typo fixed Nov 13, 2018
composer.json Add support for directory structures, remove bootstrap requirement, o… Apr 11, 2016

This uses SoftDelete


Software License

This is a file manager using Dropzone.js for Laravel 5. It provides basic functionality for managing, uploading, and deleting files.


A demo of the system can be found at

Quick Start

Here's an 4 step process to get a fully functional demo, similar to

  1. Follow the Installation instructions below.

    Getting errors?  Make sure you have a database set up (
  2. In a view (welcome.blade.php, for example), add:

        <title>Laradrop Demo</title>
        <link href="//" rel="stylesheet" type="text/css">
        <link href="/vendor/jasekz/laradrop/css/styles.css" rel="stylesheet" type="text/css">
        <link href="" rel="stylesheet" type="text/css">
        <script src="//"></script>
        <script src="//" ></script>
        <script src="/vendor/jasekz/laradrop/js/enyo.dropzone.js"></script>
        <script src="/vendor/jasekz/laradrop/js/laradrop.js"></script>
        <div class="laradrop" laradrop-csrf-token="{{ csrf_token() }}"> </div>
  1. In your .env file, add:
  1. In your config/filesystems.php, add to your disks array:
'laradrop' => [
            'driver' => 'local',
            'root' => public_path('uploads'), // will put files in 'public/upload' directory

That's it. If you have any issues or question, please feel free to open an issue.


NOTE: If you haven't set up a database yet for your app, please do that first as per Laravel docs -

Via composer

composer require jasekz/laradrop

Then in your config/app.php add


to the providers array.

Then run

artisan vendor:publish

followed by

artisan migrate

Configuration (.env)

Laradrop uses Laravel's Filesystem mechanism ( and by default will store your files in the storage/app directory. If you would like to modify this behavior, along with other default settings, you can set your .env file variables:

# s3, local, or Rackspace.  See 'Other Driver Prerequisites' at  Defaults to 'local'

# If your files need to be web accessible, set this param.  S3, for example, would be ''.  Defaults to the web root (public).

# If a thumbnail can not be generated due to incompatible file or any other reason, what image do you want to use? Defaults to 'vendor/jasekz/laradrop/img/genericThumbs/no-thumb.png'

# Max file upload size in MB.  Defaults to 10.

# Max file size (in MB) for which thumbnail generation will be attempted.  If your server has an issue processing thumbs, you can lower this value.  Defaults to 10.

# Defaults to 150px.

# Defaults to 150px.

# Run laradrop routes through middlware.  Defaults to none.


This package requires Dropzone.js, jQuery, and jQuery UI. Include these somewhere in your template:

<script src="//"></script>
<script src="//" ></script>
<script src="/vendor/jasekz/laradrop/js/enyo.dropzone.js"></script>
<script src="/vendor/jasekz/laradrop/js/laradrop.js"></script>

By default, Laradrop is designed for Bootstrap, but it's not a requirement. Include Bootstrap and the Laradrop styles if you'd like to use it:

<link href="//" rel="stylesheet" type="text/css">
<link href="/vendor/jasekz/laradrop/css/styles.css" rel="stylesheet" type="text/css">

Add the html code where you'd like to implement the file manager. Note, that by default, there is no middleware assigned to the Laradrop controller, however, it you assign middleware which contains csrf protection, you must include the laradrop-csrf-token="{{ csrf_token() }}" attribute.

<div class="laradrop" laradrop-csrf-token="{{ csrf_token() }}"> </div>

Finally, bind it using jQuery:

    // Simplest:
    // With custom params:
        breadCrumbRootText: 'My Root', // optional 
        actionConfirmationText: 'Sure about that?', // optional
        onInsertCallback: function (obj){ // optional 
            // if you need to bind the select button, implement here
             alert('Thumb src: '+obj.src+'. File ID: ''.  Please implement onInsertCallback().');
        onErrorCallback: function(msg){ // optional
            // if you need an error status indicator, implement here
            alert('An error occured: '+msg);
         onSuccessCallback: function(serverRes){ // optional
            // if you need a success status indicator, implement here


Laradrop currently fires two events:

  1. Jasekz\Laradrop\Events\FileWasUploaded - this is fired after a file has been uploaded and saved.
  2. Jasekz\Laradrop\Events\FileWasDeleted - this is fired after a file is deleted.

Handlers (upload, delete, list, etc)

If you'd like to implement your own hanldlers (or extend the existing ones with your own controllers), you can do so. All you need to do, is to defined the routes to the appropriate handlers in the button attributes. This also allows you to easily have multiple handlers for different use cases, if so desired.

<div class="laradrop"
    laradrop-file-source="{{ route('yourRoute.index') }}" 
    laradrop-upload-handler="{{ route('') }}"
    laradrop-file-delete-handler="{{ route('yourRoute.destroy', 0) }}"
    laradrop-file-move-handler="{{ route('yourRoute.move') }}"
    laradrop-file-create-handler="{{ route('yourRoute.create') }}"
    laradrop-containers="{{ route('yourRoute.containers') }}"
    laradrop-csrf-token="{{ csrf_token() }}"

File type validations

The default implementation of accept checks the file's mime type or extension against this list. This is a comma separated list of mime types or file extensions.

Eg.: image/*,application/pdf,.psd

If the Dropzone is clickable this option will also be used as accept parameter on the hidden file input as well.


The MIT License (MIT). Please see License File for more information.