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:
@@ -11,31 +11,35 @@ return new class extends Migration
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('communications', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('user_id')->nullable()->constrained('users')->nullOnDelete();
|
||||
$table->foreignId('order_id')->nullable()->constrained('orders')->nullOnDelete();
|
||||
$table->string('name');
|
||||
$table->string('email')->index();
|
||||
$table->string('phone')->nullable();
|
||||
$table->string('subject');
|
||||
$table->text('message');
|
||||
$table->string('status')->default('new')->index(); // new, in_progress, resolved, closed
|
||||
$table->text('admin_notes')->nullable();
|
||||
$table->string('ip_address', 45)->nullable();
|
||||
$table->text('user_agent')->nullable();
|
||||
$table->timestamp('last_replied_at')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
if (! Schema::hasTable('communications')) {
|
||||
Schema::create('communications', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('user_id')->nullable()->constrained('users')->nullOnDelete();
|
||||
$table->foreignId('order_id')->nullable()->constrained('orders')->nullOnDelete();
|
||||
$table->string('name');
|
||||
$table->string('email')->index();
|
||||
$table->string('phone')->nullable();
|
||||
$table->string('subject');
|
||||
$table->text('message');
|
||||
$table->string('status')->default('new')->index(); // new, in_progress, resolved, closed
|
||||
$table->text('admin_notes')->nullable();
|
||||
$table->string('ip_address', 45)->nullable();
|
||||
$table->text('user_agent')->nullable();
|
||||
$table->timestamp('last_replied_at')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
Schema::create('communication_replies', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('communication_id')->constrained('communications')->cascadeOnDelete();
|
||||
$table->foreignId('user_id')->nullable()->constrained('users')->nullOnDelete();
|
||||
$table->boolean('is_admin_reply')->default(true);
|
||||
$table->text('message');
|
||||
$table->timestamps();
|
||||
});
|
||||
if (! Schema::hasTable('communication_replies')) {
|
||||
Schema::create('communication_replies', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('communication_id')->constrained('communications')->cascadeOnDelete();
|
||||
$table->foreignId('user_id')->nullable()->constrained('users')->nullOnDelete();
|
||||
$table->boolean('is_admin_reply')->default(true);
|
||||
$table->text('message');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user