diff --git a/app/Enums/Tema.php b/app/Enums/Tema.php new file mode 100644 index 000000000..8b969163b --- /dev/null +++ b/app/Enums/Tema.php @@ -0,0 +1,43 @@ +id(); - $table->string('name'); - $table->string('vendor'); - $table->string('version'); - $table->string('description')->nullable(); - $table->string('path'); - $table->string('screenshot')->nullable(); - $table->boolean('active')->default(0); - $table->boolean('system')->default(0); - $table->mediumText('options')->nullable(); - $table->timestamps(); - }); + // cek apakah tabel das_themes ada + if (Schema::hasTable('das_themes')) { + // Kosongkan tabel + DB::table('das_themes')->truncate(); + } else { + Schema::create('das_themes', function (Blueprint $table) { + $table->id(); + $table->string('name'); + $table->string('vendor'); + $table->string('version'); + $table->string('description')->nullable(); + $table->string('path'); + $table->string('screenshot')->nullable(); + $table->boolean('active')->default(Status::TidakAktif); + $table->boolean('system')->default(Tema::TemaKostum); + $table->mediumText('options')->nullable(); + $table->timestamps(); + }); + } - scan_themes(); + try { + scan_themes(); + } catch (\Exception $e) { + Log::error('Error scanning themes: ' . $e->getMessage()); + } } /**