|
77 | 77 | <tr class="loot-row"> |
78 | 78 | @if ($showRecipient) |
79 | 79 | <td> |
80 | | - {!! Form::select($prefix . 'rewardable_recipient[]', $rewardableRecipients, $loot->rewardable_recipient, [ |
| 80 | + {!! Form::select($prefix . 'rewardable_recipient[]', $rewardableRecipients, $loot->rewardable_recipient ?? $recipient, [ |
81 | 81 | 'class' => 'form-control recipient-type', |
82 | 82 | 'placeholder' => 'Select Recipient Type', |
83 | 83 | ]) !!} |
|
86 | 86 |
|
87 | 87 | <td class="{{ $prefix }}loot-row-type"> |
88 | 88 | {{-- The long array of key value pairs is now defined in getRewardTypes and data should be moved there --}} |
89 | | - {!! Form::select($prefix . 'rewardable_type[]', getRewardTypes($showData, $loot->rewardable_recipient), $loot->rewardable_type, [ |
| 89 | + {!! Form::select($prefix . 'rewardable_type[]', getRewardTypes($showData, $loot->rewardable_recipient ?? $recipient), $loot->rewardable_type, [ |
90 | 90 | 'class' => 'form-control reward-type', |
91 | 91 | 'placeholder' => 'Select ' . $type . ' Type', |
92 | 92 | ]) !!} |
93 | 93 | </td> |
94 | 94 | <td class="{{ $prefix }}loot-row-select"> |
95 | 95 | {{-- If statements here can be removed and replaced with the below code. They are now defined programmatically --}} |
96 | | - {!! Form::select($prefix . 'rewardable_id[]', $showRecipient ? $rewardLootData[$loot->rewardable_recipient][$loot->rewardable_type] : $rewardLootData[$loot->rewardable_type], $loot->rewardable_id, [ |
| 96 | + {!! Form::select($prefix . 'rewardable_id[]', $showRecipient ? $rewardLootData[$loot->rewardable_recipient ?? $recipient][$loot->rewardable_type] : $rewardLootData[$loot->rewardable_type], $loot->rewardable_id, [ |
97 | 97 | 'class' => 'form-control ' . strtolower($loot->rewardable_type) . '-select', |
98 | 98 | 'placeholder' => 'Select ' . $rewardTypes[$loot->rewardable_type], |
99 | 99 | ]) !!} |
|
0 commit comments