common = new Common; } public function index () { $res = [ 'page' => 'home', 'style' => 'videoslist', 'userinfo' => $this->common->user, ]; $res['new'] = $this->getNewest(); $res['hot'] = $this->getPopularest(); return view('pages.peertube.home', ['res' => $res]); } function getNewest () { return $this->ptapi('/api/v1/videos?start=0&count=8&sort=-publishedAt&skipCount=true&isLocal=true&nsfw=both'); } function getPopularest () { return $this->ptapi('/api/v1/videos?start=0&count=8&sort=-trending&skipCount=true&isLocal=true&nsfw=both'); } }