project = $project; } /** * Returns count of marketing_project. * * @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.project.gadget', $count = 10) { if (User::hasRole('user')) { $this->project->pushCriteria(new \Litepie\Bixo\Repositories\Criteria\ProjectUserCriteria()); } $project = $this->project->scopeQuery(function ($query) use ($count) { return $query->orderBy('id', 'DESC')->take($count); })->all(); return view('marketing_project::' . $view, compact('project'))->render(); } }