title: how to set custom order for teams
body: <p>I'm working on a program in Laravel</p>
  
  <p>In this program, participants are divided in several teams,</p>
  
  <p>for example, team A to G
  That the tandem arrangement, with (A-> B-> C-> D-> E-> F-> G)</p>
  
  <p>For every day a team is selected (as present team) the next day after the team's innings
  In this way </p>
  
  <p>its becomes clear that every day who must be present.</p>
  
  <p>Now my question is:</p>
  
  <p>1-what form such teams is to be determined</p>
  
  <p>2-if a team was eliminated from the arrangement did not affect the connected row</p>
  
  <p>3-added a new team and be placed in any position in this row. ex(A->B->Z->C)</p>
  
  <p>this is some part of my code:</p>
  
  <p>teams-people table:</p>
  
  <pre><code>public function up()
  {
      Schema::create('teams-people', function (Blueprint $table) {
          $table-&gt;increments('id');
          $table-&gt;integer('order')-&gt;unsigned()-&gt;nullable();                        
          $table-&gt;integer('teams_id')-&gt;unsigned()-&gt;index();                        
          $table-&gt;integer('people_id')-&gt;unsigned()-&gt;index();                        
          $table-&gt;timestamps();
      });
  }
  </code></pre>
  
  <p>peoples table</p>
  
  <pre><code>public function up()
  {
      Schema::create('people', function (Blueprint $table) {
          $table-&gt;increments('id');
          $table-&gt;string('name');
          $table-&gt;boolean('gender');            
          $table-&gt;timestamps();
      });
  }
  </code></pre>
  
  <p>ORM relation</p>
  
  <pre><code>    public function team()
  {
      return $this-&gt;hasMany('App\teams-people','people_id');
  }
  </code></pre>
  
  <p>teams-people relation to people: </p>
  
  <pre><code>    public function person()
  {
      return $this-&gt;belongsTo('App\person', 'people_id');
  }
  </code></pre>
  
  <p>**One solution may be to add "next-team" column to team's table to define Which team is the next team ,But I think this can cause problems in cases Such as eliminating a team or add new team and A team can be the next team for two or more team in this way, Is there a better way?  </p>