title: Pagination with HTML Table
body: <p>In the table below, i put every student under the teacher that you belong in the table. Now, i want to rather paginate the students being shown under the table. So if 1st tab has 10 students, i could paginate to 5. </p>
  
  <p>Currently, my code doesn't do what i want to achieve.  How do i achieve this?</p>
  
  <p>PS: I know how the syntax would be if i wanted to paginate teachers like <code>teachers-&gt;links()</code> </p>
  
  <p><strong>Controller</strong></p>
  
  <pre><code>$teacher = Teacher::where('branch_id', Auth::user()-&gt;branch_id);
  return view('create',compact('teachers));
  </code></pre>
  
  <p><strong>HTML</strong></p>
  
  <pre><code>&lt;div class="nav-tabs-custom" id="tabs"&gt;
      &lt;ul  id="myUL" class="nav nav-tabs"&gt;
          @foreach($teachers as $teacher)
              &lt;li &gt;&lt;a href="#tab_{{ $teacher-&gt;id }}" data-toggle="tab" &gt;{!!$teacher-&gt;name!!}&lt;/a&gt;&lt;/li&gt;
          @endforeach
      &lt;/ul&gt;
      &lt;div class="tab-content"&gt;
          @foreach($teachers as $key =&gt; teacher)
              &lt;div class="tab-pane" id="tab_{{ $teacher-&gt;id }}"&gt;
                  &lt;table class="table" id="tables"&gt;
                      &lt;thead&gt;
                          &lt;tr&gt;
                              &lt;th&gt;&lt;/th&gt;
                              &lt;th colspan="5"&gt;&lt;/th&gt;
                              &lt;th&gt;&lt;/th&gt;
                          &lt;/tr&gt;
                      &lt;/thead&gt;
                      &lt;tbody&gt;
                          @foreach($teacher-&gt;students as $std)
                              &lt;tr&gt;
                                  &lt;td&gt;&lt;/td&gt;
                                  &lt;td&gt;{{$std-&gt;name }}&lt;/td&gt;
                                  &lt;td&gt;&lt;/td&gt;
                              &lt;/tr&gt;
                          @endforeach       
                      &lt;/tbody&gt;
                  &lt;/table&gt;
                  {{$teacher-&gt;stduents-&gt;links()}}
              &lt;/div&gt;
          @endforeach
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>