From 60e29588ea311a25cc75971de36c8768f24402bf Mon Sep 17 00:00:00 2001 From: dev Date: Sun, 24 Apr 2022 19:25:31 -0500 Subject: [PATCH] Add API back and pagination --- app/Http/Controllers/ApiController.php | 2 +- routes/api.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/ApiController.php b/app/Http/Controllers/ApiController.php index b7a8f8a..0c69c29 100644 --- a/app/Http/Controllers/ApiController.php +++ b/app/Http/Controllers/ApiController.php @@ -20,7 +20,7 @@ class ApiController extends Controller public function memes() { - $memes = Meme::get(); + $memes = Meme::paginate(100); return $memes; } diff --git a/routes/api.php b/routes/api.php index 014d36b..72b19a6 100644 --- a/routes/api.php +++ b/routes/api.php @@ -18,4 +18,4 @@ Route::middleware('auth:api')->get('/user', function (Request $request) { return $request->user(); }); -// Route::middleware('api')->get('memes', [App\Http\Controllers\ApiController::class, 'memes']); +Route::middleware('api')->get('memes', [App\Http\Controllers\ApiController::class, 'memes']);