$request->method(), 'all_data' => $request->all(), 'has_show_prices' => $request->has('show_prices'), 'has_show_stock' => $request->has('show_stock'), 'user_id' => auth()->id(), 'session_tenant_id' => session('current_tenant_id') ]); // Nimm einfach den ersten Mandanten $tenant = Tenant::first(); if (!$tenant) { \Log::error('Kein Mandant gefunden!'); return redirect()->back()->with('error', 'Kein Mandant gefunden'); } // Alte Werte loggen $oldValues = [ 'show_prices' => $tenant->show_prices, 'show_stock' => $tenant->show_stock ]; \Log::info('Alte Werte:', $oldValues); // Neue Werte setzen $newValues = [ 'show_prices' => $request->has('show_prices'), 'show_stock' => $request->has('show_stock') ]; \Log::info('Neue Werte:', $newValues); // Update durchführen $tenant->update($newValues); // Prüfen ob Update erfolgreich $tenant->refresh(); $finalValues = [ 'show_prices' => $tenant->show_prices, 'show_stock' => $tenant->show_stock ]; \Log::info('Final Werte nach Update:', $finalValues); return redirect()->route('admin.settings.tenant') ->with('success', 'DEBUG: Einstellungen gespeichert - siehe Log für Details'); } }