common = new Common; $this->count = 25; } public function index ($page=0) { $res = [ 'page' => 'trending', 'style' => 'videoslist', 'paginate' => $page, 'pagetotal' => 500, 'userinfo' => $this->common->user, ]; $res['video'] = $this->getVideo(($page*$this->count), $this->count); return view('pages.peertube.videos.trending', ['res' => $res]); } function getVideo ($start, $count) { return $this->ptapi('/api/v1/videos/?start='.$start.'&count='.$count.'&sort=-trending&skipCount=true&nsfw=both'); } }