36 lines
938 B
PHP
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');
|
|
}
|
|
};
|