@php // This file represents a common source and definition for assets used in loot_select // While it is not per se as tidy as defining these in the controller(s), // doing so this way enables better compatibility across disparate extensions $characterCurrencies = \App\Models\Currency\Currency::where('is_character_owned', 1) ->orderBy('sort_character', 'DESC') ->pluck('name', 'id'); $items = \App\Models\Item\Item::orderBy('name')->pluck('name', 'id'); $currencies = \App\Models\Currency\Currency::where('is_user_owned', 1) ->orderBy('name') ->pluck('name', 'id'); if ($showLootTables) { $tables = \App\Models\Loot\LootTable::orderBy('name')->pluck('name', 'id'); } if ($showRaffles) { $raffles = \App\Models\Raffle\Raffle::where('rolled_at', null) ->where('is_active', 1) ->orderBy('name') ->pluck('name', 'id'); } if (isset($showThemes) && $showThemes) { $themes = \App\Models\Theme::orderBy('name') ->where('is_user_selectable', 0) ->pluck('name', 'id'); } $recipes = \App\Models\Recipe\Recipe::orderBy('name')->pluck('name', 'id'); @endphp
Add Reward
@if ($loots) @foreach ($loots as $loot) @endforeach @endif
Reward Type Reward Quantity
{!! Form::select( 'rewardable_type[]', ['Item' => 'Item', 'Currency' => 'Currency'] + ($showLootTables ? ['LootTable' => 'Loot Table'] : []) + ($showRaffles ? ['Raffle' => 'Raffle Ticket'] : []) + (isset($showThemes) && $showThemes ? ['Theme' => 'Theme'] : []) + (isset($showRecipes) && $showRecipes ? ['Recipe' => 'Recipe'] : []), $loot->rewardable_type, ['class' => 'form-control reward-type', 'placeholder' => 'Select Reward Type'], ) !!} @if ($loot->rewardable_type == 'Item') {!! Form::select('rewardable_id[]', $items, $loot->rewardable_id, ['class' => 'form-control item-select selectize', 'placeholder' => 'Select Item']) !!} @elseif($loot->rewardable_type == 'Currency') {!! Form::select('rewardable_id[]', $currencies, $loot->rewardable_id, ['class' => 'form-control currency-select selectize', 'placeholder' => 'Select Currency']) !!} @elseif($showLootTables && $loot->rewardable_type == 'LootTable') {!! Form::select('rewardable_id[]', $tables, $loot->rewardable_id, ['class' => 'form-control table-select selectize', 'placeholder' => 'Select Loot Table']) !!} @elseif($showRaffles && $loot->rewardable_type == 'Raffle') {!! Form::select('rewardable_id[]', $raffles, $loot->rewardable_id, ['class' => 'form-control raffle-select selectize', 'placeholder' => 'Select Raffle']) !!} @elseif(isset($showThemes) && $showThemes && $loot->rewardable_type == 'Theme') {!! Form::select('rewardable_id[]', $themes, $loot->rewardable_id, ['class' => 'form-control theme-select selectize', 'placeholder' => 'Select Theme']) !!} @elseif($showRecipes && $loot->rewardable_type == 'Recipe') {!! Form::select('rewardable_id[]', $recipes, $loot->rewardable_id, ['class' => 'form-control recipe-select selectize', 'placeholder' => 'Select Recipe']) !!} @endif {!! Form::text('quantity[]', $loot->quantity, ['class' => 'form-control']) !!} Remove