diff --git a/backend/app/Http/Controllers/PostController.php b/backend/app/Http/Controllers/PostController.php new file mode 100644 index 0000000..9ec41b3 --- /dev/null +++ b/backend/app/Http/Controllers/PostController.php @@ -0,0 +1,29 @@ +lastPost) { + $lastPost = $request->lastPost; + } + + $posts = Post::query() + ->where(column: 'sequence', operator: '>', value: $lastPost) + ->take(10) + ->get(); + + return response([ + 'status' => 200, + 'data' => $posts, + ]); + } +} diff --git a/backend/routes/web.php b/backend/routes/web.php index d259f33..05b8696 100644 --- a/backend/routes/web.php +++ b/backend/routes/web.php @@ -1,5 +1,6 @@ group(function () { + Route::resources([ + '/posts' => PostController::class, + ]); +});