I would like to return to a view with compact variable with paginate.
public function detail(Request $request){
$data = DATA::paginate(10);
$lastPage = $data->lastPage(); //How to use this variable?
return view('user.data', compact('data'));
}
The default of this paginate will go to first page.
How do I use lastPage
variable to go to last page by default?