Comment obtenir des méta-informations de la pagination dans Laravel Controller
public function toArray($request)
{
return [
'data' => StoreResource::collection($this->collection),
'pagination' => [
"current_page" => $this->currentPage(),
"first_page_url" => $this->getOptions()['path'].'?'.$this->getOptions()['pageName'].'=1',
"prev_page_url" => $this->previousPageUrl(),
"next_page_url" => $this->nextPageUrl(),
"last_page_url" => $this->getOptions()['path'].'?'.$this->getOptions()['pageName'].'='.$this->lastPage(),
"last_page" => $this->lastPage(),
"per_page" => $this->perPage(),
"total" => $this->total(),
"path" => $this->getOptions()['path'],
],
];
}
s_a_m_e_e_r_