@extends("flowdash::layouts.{$layout}", [ 'title' => 'Drag & Drop', 'breadcrumb' => [[ 'title' => 'UI Components' ], [ 'title' => 'Drag & Drop' ]], 'new_button_label' => false ]) @section('content')

Simple Drag and Drop

Just add the data attribute data-toggle="dragula" to have drag and drop support in your container.

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.
@php $leftCards = [[ 'image' => "/vendor/flowdash/images/256_rsz_1andy-lee-642320-unsplash.jpg", 'name' => "Jenell D. Matney", 'title' => "Founder and CEO" ], [ 'image' => "/vendor/flowdash/images/256_daniel-gaffey-1060698-unsplash.jpg", 'name' => "Sherri J. Cardenas", 'title' => "Software Engineer" ], [ 'image' => "/vendor/flowdash/images/256_jeremy-banks-798787-unsplash.jpg", 'name' => "Joseph S. Ferland", 'title' => "Web Designer" ]]; $rightCards = [[ 'image' => "/vendor/flowdash/images/256_joao-silas-636453-unsplash.jpg", 'name' => "Bryan K. Davis", 'title' => "Web Developer" ], [ 'image' => "/vendor/flowdash/images/256_luke-porter-261779-unsplash.jpg", 'name' => "Elizabeth J. Ohara", 'title' => "Business Analyst" ], [ 'image' => "/vendor/flowdash/images/256_michael-dam-258165-unsplash.jpg", 'name' => "Kaci M. Langston", 'title' => "Human Resources" ]]; @endphp

Containers

Add the data attribute data-dragula-containers='["#cards-left", "#cards-right"]' to allow the user to drag an element in any of the containers and drop it in any other container in the list.

Container #1
@foreach($leftCards as $card) @component('flowdash::components.user-feedback', ['item' => $card]) @endcomponent @endforeach
Container #2
@foreach($rightCards as $card) @component('flowdash::components.user-feedback', ['item' => $card]) @endcomponent @endforeach
@component('flowdash::components.hljs')
...
...
@endcomponent

Handles

Add the data attribute data-dragula-moves="js-dragula-handle" to allow the user to drag an element in any of the containers and drop it in any other container in the list using a handle.

Container #1
@foreach($leftCards as $card) @component('flowdash::components.user-handle', ['item' => $card]) @endcomponent @endforeach
Container #2
@foreach($rightCards as $card) @component('flowdash::components.user-handle', ['item' => $card]) @endcomponent @endforeach
@endsection @section('head') @endsection @section('footer') @endsection