campaign_call = $campaign_call; $this->campaign_database = $campaign_database; } /** * Returns count of campaign. * * @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.campaign_call.gadget', $count = 10) { if (User::hasRole('user')) { $this->campaign_call->pushCriteria(new \Litepie\Bixo\Repositories\Criteria\CampaignCallUserCriteria()); } $campaign_call = $this->campaign_call->scopeQuery(function ($query) use ($count) { return $query->orderBy('id', 'DESC')->take($count); })->all(); return view('campaign::' . $view, compact('campaign_call'))->render(); } /** * Make gadget View * * @param string $view * * @param int $count * * @return View */ public function gadget($view = 'admin.campaign_database.gadget', $count = 10) { if (User::hasRole('user')) { $this->campaign_database->pushCriteria(new \Litepie\Bixo\Repositories\Criteria\CampaignDatabaseUserCriteria()); } $campaign_database = $this->campaign_database->scopeQuery(function ($query) use ($count) { return $query->orderBy('id', 'DESC')->take($count); })->all(); return view('campaign::' . $view, compact('campaign_database'))->render(); } }