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