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