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:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user