simplePaginate method
Implementation
@override
Future<Map<String, dynamic>> simplePaginate([
int perPage = 15,
List<String> columns = const ['*'],
String? pageName,
int? page,
]) async {
int currentPage = page ?? 1;
int total = await count();
final lastPage = (total / perPage).ceil();
final offset = (currentPage - 1) * perPage;
super.take(perPage).skip(offset);
final pageData = await get();
return {
'data': pageData,
'current_page': currentPage,
'per_page': perPage,
'total': total,
'last_page': lastPage,
};
}