@push('styles') @endpush
{{ __('labels.voting_options') }} @if(isset($isRequire) && $isRequire) * @endif
@if(!isset($readonly) || !$readonly) @endif
@error('vote_options')
{{ __('labels.error') }}! {{ $message }}
@enderror
@if(!isset($readonly) || !$readonly) @endif @php // Ensure voteOptions is an array $voteOptions = $voteOptions ?? []; // Default options if empty if (empty($voteOptions)) { $voteOptions = [ ['id' => null, 'label' => __('labels.yes'), 'votes_count' => 0, 'is_new' => true], ['id' => null, 'label' => __('labels.no'), 'votes_count' => 0, 'is_new' => true] ]; } @endphp @foreach ($voteOptions as $index => $voteOption) @php $hasVotes = isset($voteOption['votes_count']) && $voteOption['votes_count'] > 0; $canDelete = !$hasVotes && (!isset($readonly) || !$readonly); @endphp @if(!isset($readonly) || !$readonly) @endif @endforeach
# {{ strtoupper(__('labels.option')) }}{{ __('labels.action') }}
{{ $index+1 }}
@if($voteOption['id'] ?? false) @endif @if($hasVotes) {{ $voteOption['votes_count'] }} {{ __('labels.votes') }} @endif
@if($hasVotes) {{ __('labels.cannot_edit_has_votes') }} @endif
@if(!isset($readonly) || !$readonly) {{-- --}} @endif