Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

nadniesol's avatar

Duplicate table on one controller

in my index function I created a $rows = new Student; and $ctrrows = new Student; my problem is I dont get anything in my $ctrrows, what should I do?

I do that because I need to count of all the balance of all students with out paging.

0 likes
4 replies
Mandrizzy's avatar
Level 5

Well you could set $ctrrows=$rows if they are to be the same student.

1 like
nadniesol's avatar

ok, but is it necessary that we need pagination? like this $rows = $rows->paginate(30);

TypicalPlayer's avatar

Pagination will be needed, depends on how many data you will present.

On the other hand, $ctrrows=$rows is correct but if you would used $rows in a computation or condition, the value it would hold is the equal to the column "new Student".

1 like
Mandrizzy's avatar

I believe its up to you use it when you don't want to overwhelm the user with too much information at once

1 like

Please or to participate in this conversation.