PHP code example of gaspertrix / laravel-backpack-dropzone-field
1. Go to this page and download the library: Download gaspertrix/laravel-backpack-dropzone-field library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
gaspertrix / laravel-backpack-dropzone-field example snippets
...
class EntityCrudController extends CrudController
{
...
use \Gaspertrix\LaravelBackpackDropzoneField\App\Http\Controllers\Operations\MediaOperation;
...
}
bash
php artisan gaspertrix:backpack:dropzone:install
bash
php artisan vendor:publish --provider="Gaspertrix\LaravelBackpackDropzoneField\DropzoneFieldServiceProvider" --tag="views"
...
$this->crud->operation(['update'], function() {
$this->crud->addField([
'label' => 'Photos',
'type' => 'dropzone_media',
'view_namespace' => 'dropzone::fields',
'name' => 'photos',
'collection' => 'photos',
'thumb_collection' => 'thumbs',
'options' => [
'thumbnailHeight' => 120,
'thumbnailWidth' => 120,
'maxFilesize' => 10,
'addRemoveLinks' => true,
'createImageThumbnails' => true,
],
]);
});
...