title: Struggling to define a polymorphic relationship which includes a BelongsTo
body: <p>I'm working on a text-based, rng-based motorsport &quot;simulator&quot; and I'm now at the point where I want to add qualifying. Since there's many different types of qualifying sessions across real life motorsport, I want to give the user the ability to use whatever format they like.</p>
  <p>I have a <code>Season</code> model, to which the a qualifying format will belong. The different formats are defined as separate models themselves, for example <code>ThreeSessionElimination</code> and <code>SingleSession</code>. The migrations for these would look something like this;</p>
  <pre><code>Schema::create('three_session_eliminations', function (Blueprint $table) {
      $table-&gt;unsignedBigInteger('id')-&gt;primary();
      $table-&gt;foreignId('season_id')-&gt;constrained();
      $table-&gt;unsignedInteger('q2_driver_count');
      $table-&gt;unsignedInteger('q3_driver_count');
      $table-&gt;unsignedInteger('runs_per_session');
      $table-&gt;unsignedInteger('min_rng');
      $table-&gt;unsignedInteger('max_rng');
      $table-&gt;timestamps();
  });
  </code></pre>
  <p>and</p>
  <pre><code>Schema::create('single_sessions', function (Blueprint $table) {
      $table-&gt;unsignedBigInteger('id')-&gt;primary();
      $table-&gt;foreignId('season_id')-&gt;constrained();
      $table-&gt;unsignedInteger('runs_per_session');
      $table-&gt;unsignedInteger('min_rng');
      $table-&gt;unsignedInteger('max_rng');
      $table-&gt;timestamps();
  });
  </code></pre>
  <p>My initial thought was to add</p>
  <pre><code>public function season(): BelongsTo
  {
      return $this-&gt;belongsTo(Season::class);
  }
  </code></pre>
  <p>to each qualifying format model, but obviously the inverse can't be a <code>HasOne</code> since there's different tables for each different format.</p>
  <p>I've had a look at the <a href="https://laravel.com/docs/9.x/eloquent-relationships#one-to-many-polymorphic-relations" rel="nofollow noreferrer">&quot;One To Many (Polymorphic)&quot; relation documentation</a>, but I can't quite wrap my head around how I should apply that in my case. Would I have to add a <code>qualifying_format_id</code> and <code>qualifying_format_type</code> to my <code>Season</code> model and remove the <code>season_id</code> column from each format migration to make this work?</p>