}
$mode = $this->getMode($ladderEntry);
$episode->event()->associate($event);
+ $episode->stepLadderMode()->associate($mode);
$episode->title = $mode->name;
$episode->start = Carbon::createFromTimestamp($ladderEntry['time']);
$episode->estimate = 2 * 60 * 60;
}
$mode = $this->getMode($ladderEntry);
$episode->event()->associate($event);
+ $episode->stepLadderMode()->associate($mode);
$episode->title = $mode->name;
$episode->start = Carbon::createFromFormat('Y-m-d H:i:s', $ladderEntry['time'], 'America/Detroit')->setTimezone('UTC');
$episode->estimate = 2 * 60 * 60;
return $this->hasMany(EpisodePlayer::class);
}
+ public function stepLadderMode() {
+ return $this->belongsTo(StepLadderMode::class);
+ }
+
public function getScheduledEventName(): string {
$parts = [];
if (count($this->players) == 4) {
--- /dev/null
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+return new class extends Migration
+{
+ /**
+ * Run the migrations.
+ */
+ public function up(): void {
+ Schema::table('episodes', function (Blueprint $table) {
+ $table->foreignId('step_ladder_mode_id')->nullable()->default(null)->constrained();
+ });
+ }
+
+ /**
+ * Reverse the migrations.
+ */
+ public function down(): void {
+ Schema::table('episodes', function (Blueprint $table) {
+ $table->dropColumn('step_ladder_mode_id');
+ });
+ }
+};