Files
landing-api/database/migrations/2026_08_13_150100_create_notifications_table.php
Josep Piguillem 3897113313 Initial commit: Pireon Admin — headless admin panel and public API
Laravel 13 + Filament 5 admin panel and REST API for a non-profit developer
collective, backed by the Pireon OAuth identity server. The public site is a
separate, server-rendered application consuming /api/public/v1.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-19 17:55:27 +02:00

39 lines
1.1 KiB
PHP

<?php
declare(strict_types=1);
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
/**
* Backs Filament's notification bell.
*
* An inbox nobody is told about is an inbox nobody reads, and the person who
* runs a call is not the person refreshing the panel all day.
*/
return new class extends Migration
{
public function up(): void
{
Schema::create('notifications', function (Blueprint $table) {
$table->uuid('id')->primary();
$table->string('type');
$table->morphs('notifiable');
/*
* `jsonb`, not the `text` Laravel's own stub uses: Filament's bell
* queries this column by JSON path — `data->>'format'` — and
* Postgres has no such operator for text. SQLite never noticed.
*/
$table->jsonb('data');
$table->timestamp('read_at')->nullable();
$table->timestamps();
});
}
public function down(): void
{
Schema::dropIfExists('notifications');
}
};