Skip to main content

Posts

Showing posts from November, 2023

How to create remove and add more inputs functionality with input type file and text in Laravel?

Create remove and add more inputs functionality with input type file and text in Laravel Blade file code       <form action="{{ route('storeDocuments') }}" method="post" enctype="multipart/form-data">         @csrf         <div id="inputFields">             @if(!empty($documents[0]))             @php $counter = 1000; @endphp                 @foreach($documents as $document)                     <input type="hidden" id="document_id" name="documents[{{$counter}}][document_id]" value="{{$document->id}}">                     <div class="field">                         <label for="title">Title:</label>                         <input type="text" id="title" class="title_input" name="documents[{{$counter}}][title]" value="{{$document->title}}" required>                         <label for=&