influencer = $influencer; $this->social = $social; } /** * Returns count of influencer. * * @param array $filter * * @return int */ public function count() { return 0; } /** * Make gadget View * * @param string $view * * @param int $count * * @return View */ public function gadget($view = 'admin.influencer.gadget', $count = 10) { if (User::hasRole('user')) { $this->influencer->pushCriteria(new \Litepie\Boomee\Repositories\Criteria\InfluencerUserCriteria()); } $influencer = $this->influencer->scopeQuery(function ($query) use ($count) { return $query->orderBy('id', 'DESC')->take($count); })->all(); return view('influencer::' . $view, compact('influencer'))->render(); } /** * Make gadget View * * @param string $view * * @param int $count * * @return View */ public function gadget($view = 'admin.social.gadget', $count = 10) { if (User::hasRole('user')) { $this->social->pushCriteria(new \Litepie\Boomee\Repositories\Criteria\SocialUserCriteria()); } $social = $this->social->scopeQuery(function ($query) use ($count) { return $query->orderBy('id', 'DESC')->take($count); })->all(); return view('influencer::' . $view, compact('social'))->render(); } }