@extends('layout') @push('styles') @endpush @section('content') @if (session('success'))
×

{{ __('Success!') }}

{{ session('success') }}

@endif @if (session('error'))
×

{{ __('Error!') }}

{{ session('error') }}

@endif

{{ __('All Questions') }}

{{ __('Overview') }}

{{-- Tabs / Filters (All | Open Ended | Yes/No | Multiple Choice) --}}
@php // Build base query string excluding 'page' so tabs reset to page 1 $baseQuery = request()->except(['page', 'type']); $currentType = request('type', 'all'); @endphp @foreach ($types as $type) @endforeach
{{-- Filters Row (search, sort, date) --}}
{{-- Keep type when changing other filters --}} {{-- Search --}} {{-- Sort --}} {{-- Direction --}} {{-- Date --}} {{-- Buttons (INLINE on Desktop, WRAP on Mobile) --}}
{{ __('Reset') }}
{{-- Table --}}
@forelse($questions as $question) @empty @endforelse
{{ __('Question') }} {{ __('Type') }} {{ __('Options Count') }} {{ __('Created Date') }}
icon

{{ Str::limit($question->question, 80) }} ID-{{ $question->id }}

{{ __($question->type) }} @if ($question->options_count) {{ $question->options_count }} @else — @endif {{ optional($question->created_at)->format('M d, Y') }}
{{-- Action Trigger --}} {{-- Dropdown Menu --}}
@can('questions.edit') icon {{ __('Edit') }} @endcan @can('questions.destroy')
@csrf @method('DELETE')
@endcan

{{ __('Are you sure?') }}

{{ __('This action cannot be undone.') }}

{{ __('No questions found.') }}
{{-- Items per page dropdown --}}
@foreach (request()->except('per_page') as $key => $value) @endforeach
{{-- Pagination Display --}}

{{ __('Page') }} {{ $questions->currentPage() }} {{ __('of') }} {{ $questions->lastPage() }}

{{-- Previous --}} @if ($questions->onFirstPage()) @else icon @endif {{-- Next --}} @if ($questions->currentPage() == $questions->lastPage()) @else icon @endif
{{-- Optional small script: press Enter in search to submit --}} @endsection