@extends('layouts.admin.app') @section('content')
Kembali Ke Pertanyaan
Edit Pertanyaan
Game / Pertanyaan / Edit Pertanyaan
@php $textOption = [['answer' => '', 'value' => '', 'type' => '']]; $oldTextOptions = old('text_options') ?? $result->options; $textOptions = $result->type == 'text' ? $oldTextOptions : $textOption; $imageOption = [['image' => '', 'value' => '', 'type' => '']]; $oldImageOptions = old('image_options') ?? $result->options; $imageOptions = $result->type == 'image' ? $oldImageOptions : $imageOption; @endphp
@csrf @method('PUT')
@error('question')
{{ $message }}
@enderror
{{-- JAWABAN TEXT --}}
@foreach ($textOptions as $key => $option)
@if (isset($option['id'])) @else @endif
@error("text_options.{$key}.answer")
{{ $message }}
@enderror
@error("text_options.{$key}.value")
{{ $message }}
@enderror
@endforeach
Tambah Jawaban
{{-- JAWABAN TEXT --}} {{-- JAWABAN GAMBAR --}}
@foreach ($imageOptions as $key => $option)
@if (isset($option['id'])) @else @endif
@error("image_options.{$key}.image")
{{ $message }}
@enderror
@error("image_options.{$key}.value")
{{ $message }}
@enderror
@endforeach
Tambah Jawaban
{{-- JAWABAN GAMBAR --}}

@endsection @section('js') @endsection