Fix subscribers page - use items() instead of through() for pagination
This commit is contained in:
parent
9ad058339a
commit
0187c2d822
1 changed files with 1 additions and 6 deletions
|
|
@ -19,12 +19,7 @@ class SubscriberController extends Controller
|
||||||
->paginate(50);
|
->paginate(50);
|
||||||
|
|
||||||
return Inertia::render('Admin/Subscribers/Index', [
|
return Inertia::render('Admin/Subscribers/Index', [
|
||||||
'subscribers' => $subscribers->through(fn ($sub) => [
|
'subscribers' => $subscribers->items(),
|
||||||
'id' => $sub->id,
|
|
||||||
'email' => $sub->email,
|
|
||||||
'is_active' => $sub->is_active,
|
|
||||||
'created_at' => $sub->created_at->format('Y-m-d H:i'),
|
|
||||||
]),
|
|
||||||
'pagination' => [
|
'pagination' => [
|
||||||
'current_page' => $subscribers->currentPage(),
|
'current_page' => $subscribers->currentPage(),
|
||||||
'last_page' => $subscribers->lastPage(),
|
'last_page' => $subscribers->lastPage(),
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue