@extends('layouts.app') @section('content')
Session Form
{{--

--}}

ABOUT YOURSELF

@csrf @php // Grouping questions by heading first, then by question_id $groupedHeadings = $questions->groupBy('question_heading'); @endphp
@php $sl = $questions->firstItem(); @endphp @foreach($questions as $qs_id => $questionGroup) @php $question = $questionGroup->first(); @endphp @php $sl++ @endphp @endforeach
S.No Question Options
{{ $sl }} {{ $question->question }} @foreach($questionGroup as $ans) @if($ans->answer !== 'text' && $ans->answer !== '6')
@endif @endforeach @foreach($questionGroup as $ans) @if($ans->answer === 'text' || $ans->answer === '6') @endif @endforeach
{{ $questions->links('pagination::bootstrap-4') }}
{{-- Submit button outside the loop, at the bottom of the form --}}
{{-- Pagination Links --}} {{--
{{ $questions->links() }}
--}} @endsection @push('js') @endpush