@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
| {!! 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'] : []), null, ['class' => 'form-control reward-type', 'placeholder' => 'Select Reward Type'], ) !!} | {!! Form::text('quantity[]', 1, ['class' => 'form-control']) !!} | Remove |