public function bookingsIndex(Request ) { \ = app()->bound('current_tenant') ? app('current_tenant') : null; if (!\) { \ = \->query('simulate_host') ?: session('simulated_host'); if (\) { \ = \App\Models\Tenant::where('custom_domain', \)->first(); } } if (!\) { \ = \App\Models\Tenant::first(); } if (!\) { return redirect()->route('admin.login'); } \ = strtolower(str_replace([' ', '.'], '', \->name)) . '@imhappy.com'; \ = \App\Models\User::where('email', \)->first(); \ = \ ? \App\Models\Counsellor::where('user_id', \->id)->first() : null; if (\) { \ = \App\Models\Booking::with(['user', 'sessionType'])->where('counsellor_id', \->id)->orderBy('created_at', 'desc')->get(); } else { \ = collect(); } return view('admin.bookings', compact('tenant', 'bookings')); }