byPage() public method

Get paginated recipes.
public byPage ( integer $page = 1, integer $limit = 10 ) : Illuminate\Pagination\LengthAwarePaginator
$page integer Page number
$limit integer Number of recipes per page
return Illuminate\Pagination\LengthAwarePaginator
Example #1
0
 public function test_Should_GetRecipesByPage()
 {
     Factory::createList('App\\Models\\Recipe', [['name' => 'Recipe 1', 'description' => '', 'body' => ''], ['name' => 'Recipe 2', 'description' => '', 'body' => ''], ['name' => 'Recipe 3', 'description' => '', 'body' => ''], ['name' => 'Recipe 4', 'description' => '', 'body' => ''], ['name' => 'Recipe 5', 'description' => '', 'body' => '']]);
     $recipeRepository = new EloquentRecipe(new App\Models\Recipe());
     $foundRecipes = $recipeRepository->byPage();
     $this->assertCount(5, $foundRecipes->items());
 }