This is the first time I'm using dropzone js. I've following requirement.
My form has following fields
- Name
- Category
- Description
- Images
Here Name is input field, Category is selector, Description is Textfield and Images is multiple file upload field.
{{ csrf_field() }}
<div class="form-group">
<label for="name" class="col-form-label">Name</label>
<div>
<input type="text" name="name" class="form-control"
required placeholder="Enter Name of the Package" value="@if(isset($package)) {{$package->name}} @else {{old('name')}}@endif" />
</div>
</div>
<div class="form-group">
<label for="category_id" class="col-form-label">Select</label>
<select class="form-control" name="category_id" required>
<option value="">Select Category</option>
@foreach($categories as $category )
<option value="{{$category->id}}"
@if(isset($package))
@if($package->category_id==$category->id)
selected
@endif
@else
@if(old('category_id') == $category->id)
selected
@endif
@endif
>{{$category->name}}</option>
@endforeach
</select>
</div>
<div class="form-group">
<label>Description</label>
<textarea name="description" class="form-control" required placeholder="Type something">{{isset($package) ? $package->description:old('description')}}</textarea>
</div>
<div class="form-group">
//here I need multiple file upload field with dropzone js
</div>
My problem is files are not attached when form is submitted as normal post request. Is there any way to make such custom form in laravel.
I've found a lot of solution with form having image upload field only but i didn't find solution for my case. If you need further information, feel free to ask. Thanks,