emissionService = $emissionService; } public function index(Request $request) { try { $data['inventoryYear'] = $request->input('year', date('Y')); $data['dashboardData'] = $this->emissionService->getDashboardData($data['inventoryYear']); $data['title'] = $this->title; $data['route'] = $this->route; return view($this->template.'.dashboard', $data); } catch (\Exception $e) { Log::error('Error loading dashboard data', [ 'message' => $e->getMessage(), 'trace' => $e->getTraceAsString(), ]); } } }