9 months ago

How to fetch dynamic textfield name field in laravel

Posted 9 months ago by Deekshith

Hi Guys, I have a form with dynamic input fields like below,

{{ csrf_field() }} @foreach($get_contest_detail->questions as $que)
                    <p>{!! $que->question !!}</p>
                    <textarea rows="4" cols="50" id="question{{$que->id}}" name="question{{$que->id}}" class="form-control" required></textarea>



                    <input type="submit" class="btn btn-primary btn-sm" value="Submit" />


I can submit the form in post controller function I can see all posted form fields like below,


So now I am trying to fetch above the field in laravel in know how to do that in normal forms like below, $request->question. But how can i fetch dynamic form fields like above? I tried below code but it is not working.

foreach($get_contest_detail->questions as $que) {

            return back()->withErrors('Please fill all questions.');

Please sign in or create an account to participate in this conversation.