2025_12_04_000003_create_submissions_table.php 890 B

12345678910111213141516171819202122232425262728293031
  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. public function up(): void
  8. {
  9. Schema::create('submissions', function (Blueprint $table) {
  10. $table->id();
  11. $table->string('name', 100);
  12. $table->string('email', 255);
  13. $table->text('message')->nullable();
  14. $table->string('ip_address', 45)->nullable();
  15. $table->enum('status', ['active', 'archived', 'pending'])->default('active');
  16. $table->timestamps();
  17. $table->softDeletes();
  18. $table->index('email');
  19. $table->index('status');
  20. $table->index('created_at');
  21. });
  22. }
  23. public function down(): void
  24. {
  25. Schema::dropIfExists('submissions');
  26. }
  27. };