Fix timezone to Europe/Amsterdam, fix 500 error on communication and customer pages with bulletproof schema helper, and redesign admin header to compact grouped dropdowns

This commit is contained in:
2026-11-02 11:05:28 +01:00
parent da9992e060
commit 560a6ae20b
10 changed files with 327 additions and 169 deletions
+2 -10
View File
@@ -2,11 +2,9 @@
namespace App\Http\Middleware;
use App\Services\DatabaseSchemaHelper;
use Closure;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Artisan;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Schema;
use Symfony\Component\HttpFoundation\Response;
class EnsureUserIsAdmin
@@ -28,13 +26,7 @@ class EnsureUserIsAdmin
// Auto-migrate check: Ensure that new database tables (like communications) are migrated
// automatically when an admin enters the admin panel, avoiding 500 errors on Coolify/production.
try {
if (! Schema::hasTable('communications')) {
Artisan::call('migrate', ['--force' => true]);
}
} catch (\Throwable $e) {
Log::warning('Auto-migration in EnsureUserIsAdmin failed: '.$e->getMessage());
}
DatabaseSchemaHelper::ensureCommunicationsTables();
return $next($request);
}