input('current') ? $request->input('current') : 1; $pageSize = 5; $model = Notice::orderBy('created_at', 'DESC') ->where('show', 1); $total = $model->count(); $res = $model->forPage($current, $pageSize) ->get(); return response([ 'data' => $res, 'total' => $total ]); } }