コード例 #1
0
 /**
  * Paginate all the videos in the database.
  *
  * @return view
  */
 public function index()
 {
     $videos = Videos::paginate(6);
     $categories = $this->getCategories;
     return view('welcome', compact('videos', 'categories'));
 }
コード例 #2
0
 /**
  * Test videos are paginated.
  *
  * @return void
  */
 public function testVideosPaginated()
 {
     factory(Soma\Videos::class, 24)->create();
     $results = Videos::paginate(6);
     $this->assertEquals(6, $results->perPage());
 }