Skip to content

Commit

Permalink
Copy over last builds Minecraft version when creating a new modpack b…
Browse files Browse the repository at this point in the history
…uild
  • Loading branch information
rtm516 committed Aug 7, 2022
1 parent 7c3ee5c commit 547bf33
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion resources/views/modpack/build/create.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,16 @@
</div>
<div class="form-group">
<label for="version">Minecraft Version</label>
@php
$lastBuild = $modpack->builds()->latest('updated_at')->first();
$lastVersion = "";
if (!empty($lastBuild)) {
$lastVersion = $lastBuild->minecraft;
}
@endphp
<select class="form-control" name="minecraft">
@foreach ($minecraft as $version)
<option value="{{ $version['version'] }}">{{ $version['version'] }}</option>
<option value="{{ $version['version'] }}" {{ $lastVersion == $version['version'] ? 'selected' : '' }}>{{ $version['version'] }}</option>
@endforeach
</select>
</div>
Expand Down

0 comments on commit 547bf33

Please sign in to comment.