2025_09_17_033900_create_badges_table.php 811B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. use Illuminate\Database\Migrations\Migration;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Support\Facades\Schema;
  5. return new class extends Migration
  6. {
  7. /**
  8. * Run the migrations.
  9. */
  10. public function up(): void
  11. {
  12. Schema::create('badges', function (Blueprint $table) {
  13. $table->id();
  14. $table->json("title")->nullable()->comment("標題");
  15. $table->string("img_url")->comment("image url");
  16. $table->json("img_alt")->comment("alt");
  17. $table->integer("order")->default(0);
  18. $table->boolean("visible")->default(1);
  19. $table->timestamps();
  20. });
  21. }
  22. /**
  23. * Reverse the migrations.
  24. */
  25. public function down(): void
  26. {
  27. Schema::dropIfExists('badges');
  28. }
  29. };