lybuneiv/dropzone

Upload image by dropzone

1.0.2 2021-03-22 02:01 UTC

This package is auto-updated.

Last update: 2024-09-13 10:43:38 UTC


README

Dropzone module.

Installation

You can install the package using Composer:

composer require lybuneiv/dropzone

Then add the service provider to config/app.php:

Lybuneiv\Dropzone\DropzoneServiceProvider::class

Publish the all file:

php artisan vendor:publish --provider="Lybuneiv\Dropzone\DropzoneServiceProvider" --force

Or

Publish the config file:

php artisan vendor:publish --provider="Lybuneiv\Dropzone\DropzoneServiceProvider" --tag="config"

Publish the public file:

php artisan vendor:publish --provider="Lybuneiv\Dropzone\DropzoneServiceProvider" --tag="public"

Publish the view file:

php artisan vendor:publish --provider="Lybuneiv\Dropzone\DropzoneServiceProvider" --tag="views"

Then symlink storage link:

php artisan storage:link

Usage

Add dropzone style in header

{!! Dropzone::renderDropzoneCss() !!}

Add dropzone script

{!! Dropzone::renderDropzoneJs() !!}

Single image html $has_caption => true or false $has_description => true or false

You will get input_data => input_name, input_name_url, input_name_caption, input_name_description

{!! Dropzone::renderSingle($url_image, 'input_name', 'class_name', $has_caption, 'text_caption', $has_description, 'text_description') !!}

Single image js

{!! Dropzone::renderSingleJs('class_name') !!}

Multiple image html $has_caption => true or false $has_description => true or false

$array_image = [

[
    'image_url' => 'https://discoverlaos.today/img/promotion/07ac6a3aa112198b491b2bcd79a6d2a6.jpg?p=image700x450',
    'main' => true,
    'caption' => 'caption1',
    'description' => 'description1'
]

];

You will get input_data => input_name[0][image_name], input_name[0][image_url], input_name[0][main], input_name[0][caption], input_name[0][description]

{!! Dropzone::renderMultiple($array_image, 'input_name', 'class_name', $has_caption, $has_description) !!}

Multiple image js

{!! Dropzone::renderMultipleJs('class_name') !!}