orderRepository->filter([ 'status' => 0 ]); $invocie_unpaid = $this->invoiceRepository->filter( [ 'status' => 0 ] ); $tickets = $this->ticketRepository->filter( [ 'status' => 1 ] )->unique('ticket_num'); $customers = $this->customerRepository->getCount(); $total_amount = $this->invoiceRepository->filter()->sum('total'); $total_amount_year = $this->invoiceRepository->get_billing_year(date('Y')); $total_amount_month = $this->invoiceRepository->get_billing_month(date('m')); $total_amount_day = $this->invoiceRepository->get_billing_day(Carbon::today()); $posts = $this->postRepository->filter([ 'limit' => 6 ]); $logs = $this->logRepository->filter( [ 'limit' => 6 ] ); $vmwares = $this->vmwareRepository->filter( [ 'limit' => 6, 'status' => [ 'key' => 'status', 'condition' => 'NotIn', 'value' => [3] ] ], [ 'ipaddress', 'customer' ] ); $hostings = $this->moduleHostingRepository->filter( [ 'status' => [ 'key' => 'status', 'condition' => 'NotIn', 'value' => [3] ], 'limit' => 6 ], [ 'customer' ] ); $orders = $this->orderRepository->filter( [ 'limit' => 6, 'invoice_id' => [ 'key' => 'invoice_id', 'condition' => 'NotIn', 'value' => [0] ] ], [ 'customer' ] ); $staffs = $this->staffRepository->filter([], ['user']); return view( 'admin.home', compact( 'title', 'pending_order', 'invocie_unpaid', 'tickets', 'customers', 'total_amount', 'total_amount_year', 'total_amount_month', 'total_amount_day', 'posts', 'logs', 'vmwares', 'hostings', 'orders', 'staffs' ) ); } public function SystemLog(Request $request) { $logs = $this->logRepository->filter( [ 'page' => $request->get('page') ?? 1 ], [ 'customer' ] ); $title = 'System Activity Log'; return view('admin.log', compact('title', 'logs')); } public function ClearCache() { Artisan::call('cache:clear'); Artisan::call('config:clear'); Artisan::call('route:clear'); Artisan::call('view:clear'); return redirect()->back()->with('success', 'Cache cleared successfully'); } }