2025_09_04_072958_create_banners_table.php 893B

12345678910111213141516171819202122232425262728293031323334
  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('banners', function (Blueprint $table) {
  13. $table->id();
  14. $table->json("title")->nullable()->comment("大字標題");
  15. $table->json("content")->nullable()->comment("小標字體");
  16. $table->string("img_url")->comment("image url");
  17. $table->json("img_alt")->comment("alt");
  18. $table->integer("order")->default(0);
  19. $table->boolean("visible")->default(1);
  20. $table->timestamps();
  21. });
  22. }
  23. /**
  24. * Reverse the migrations.
  25. */
  26. public function down(): void
  27. {
  28. Schema::dropIfExists('banners');
  29. }
  30. };