Better explaining how you are exporting.
Laravel Excel skip and take not working
Hello everyone thank you for your time firstly,
I was working with Laravel excel to export data from my database to excel, everything was going well but right now I am stuck on a small problem, I dont want the user to be able to export the entire table at once I want to allow him to export only 10-25-50-100 per time, and at the same time i have pagination so if the user is in page 2 i want to get only 25 records from page 2, this is how i was attempting:
return $query->skip(($this->page - 1) * $this->perPage)
->take($this->perPage);
This works but it just exports the entire table without perPage/pagination(and i did test perPage and page do come correctly i did dd them)
Thank you for your answers.
@WhisperingWolf in your collection method you start off using $query but then switch to $this->query
Please or to participate in this conversation.