2025_05_20_090304_create_notifications_table.php 726B

1234567891011121314151617181920212223242526272829303132
  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('notifications', function (Blueprint $table) {
  13. $table->uuid('id')->primary();
  14. $table->string('type');
  15. $table->morphs('notifiable');
  16. $table->text('data');
  17. $table->timestamp('read_at')->nullable();
  18. $table->timestamps();
  19. });
  20. }
  21. /**
  22. * Reverse the migrations.
  23. */
  24. public function down(): void
  25. {
  26. Schema::dropIfExists('notifications');
  27. }
  28. };