#### How to add dynamic pagination to LaravelExcel

I want to download some data from view using LaravelExcel. So here is my Export Class:

class StudentExportView implements FromView
{
/**
* @return IlluminateSupportCollection
*/
public function view(): View
{
$student = new Student();$students = $student->searchStudents()->paginate(20);$custom = new Student();
$customs =$custom->all();
}
}


As you can see I have used paginate(20) because the data that I’m going to download is so LARGE, and I have to use this pagination.

Then at the Controller, I added this method:

public function export_view()
{

Route::get('export_view','[email protected]_view')->name('students.export_view');