Files
Paymenter-Version-Tracks/database/migrations/2025_10_08_193743_create_notifications_table.php
Muhammad Tamir b3933b9960 v1.4.0
2025-11-14 10:59:24 +07:00

36 lines
938 B
PHP

<?php
use App\Models\User;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('notifications', function (Blueprint $table) {
$table->id();
$table->foreignIdFor(User::class)->constrained()->onDelete('cascade');
$table->string('title');
$table->text('body');
$table->string('url')->nullable();
$table->timestamp('read_at')->nullable();
$table->boolean('show_in_app')->default(true);
$table->boolean('show_as_push')->default(true);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('notifications');
}
};