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