ownerRef($request); $location = $this->location($request); $tables = $this->scopeToLocation($request, PosTable::owned($owner)) ->with('currentSale') ->orderBy('area') ->orderBy('position') ->orderBy('label') ->get(); $openTickets = $this->scopeToLocation($request, PosSale::owned($owner)) ->openTickets() ->with('table') ->withCount('lines') ->latest('opened_at') ->get(); return view('pos.floor', [ 'location' => $location, 'tables' => $tables, 'tablesByArea' => $tables->groupBy(fn (PosTable $t) => $t->area ?: 'Floor'), 'openTickets' => $openTickets, ]); } public function qr(Request $request, PosTable $table): View { $this->authorizeOwner($request, $table); return view('pos.tables.qr', [ 'table' => $table, 'url' => route('pos.table.menu', $table->ensureShortCode()), ]); } }