/** * 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')); }
/** * Test videos are paginated. * * @return void */ public function testVideosPaginated() { factory(Soma\Videos::class, 24)->create(); $results = Videos::paginate(6); $this->assertEquals(6, $results->perPage()); }