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