Files
hoshpoint-backend/database/migrations/2026_07_06_150000_create_notifications_table.php
soheil khaledabadi ae974c2afa feat: add ApiResponse trait for standardized API responses
chore: update composer dependencies to include phppresentation

chore: update composer.lock after adding phppresentation

feat: create categories migration for category management

feat: create templates migration for template storage

feat: create template generations migration for tracking template usage

feat: create template keys migration for template customization

feat: create notifications migration for user notifications

feat: update API routes for categories, templates, and user profile management

docs: update API documentation to include new endpoints for profile and wallet
2026-07-07 01:03:12 +03:30

31 lines
842 B
PHP

<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up(): void
{
Schema::create('notifications', function (Blueprint $table) {
$table->id();
$table->foreignId('user_id')->constrained()->cascadeOnDelete();
$table->string('type');
$table->string('title');
$table->text('body');
$table->json('data')->nullable();
$table->timestamp('read_at')->nullable();
$table->timestamps();
$table->index(['user_id', 'created_at']);
$table->index(['user_id', 'read_at']);
});
}
public function down(): void
{
Schema::dropIfExists('notifications');
}
};