checkAuth()) { return $this->renderForLoggedInUser($request); } return redirect()->intended('/login'); } private function renderForLoggedInUser(Request $request) { $authCheckProvider = new AuthCheckProvider; $inertiaProvider = new InertiaProvider('Dashboard/Dashboard', [ 'myInvoices' => $this->invoices->getMyInvoicesWidget(), 'myParticipations' => $this->eventParticipants->getMyParticipations(), ]); return $inertiaProvider->render(); } private function renderForGuest(Request $request) { } public function getMyInvoices() : JsonResponse { $invoices = $this->invoices->getMyInvoicesWidget(); return response()->json(['myInvoices' => $invoices]); } public function getOpenCostUnits() : JsonResponse { $costUnits = $this->costUnits->listForSummary(5); return response()->json(['openCostUnits' => $costUnits]); } public function getMyParticipations() : JsonResponse { //dd($this->eventParticipants->getMyParticipations()); return response()->json(['myParticipations' => $this->eventParticipants->getMyParticipations()]); } }