Skip to content

Commit 5843168

Browse files
committed
Bugfix: cannot send notification
1 parent bf77f00 commit 5843168

2 files changed

Lines changed: 30 additions & 0 deletions

File tree

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?php
2+
3+
use Illuminate\Database\Migrations\Migration;
4+
use Illuminate\Database\Schema\Blueprint;
5+
use Illuminate\Support\Facades\Schema;
6+
7+
return new class extends Migration
8+
{
9+
/**
10+
* Run the migrations.
11+
*/
12+
public function up(): void
13+
{
14+
if (!Schema::hasTable('notifications')) {
15+
return;
16+
}
17+
$columnToCheck = collect(Schema::getColumns('notifications'))->firstWhere('name', 'notifiable_id');
18+
if ($columnToCheck['type'] ?? '' == 'integer') {
19+
Schema::table('notifications', function (Blueprint $table) {
20+
$table->dropMorphs('notifiable');
21+
});
22+
Schema::table('notifications', function (Blueprint $table) {
23+
$table->after('type', function (Blueprint $table) {
24+
$table->uuidMorphs('notifiable');
25+
});
26+
});
27+
}
28+
}
29+
};

src/InspireCmsServiceProvider.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,7 @@ protected function getMigrations(): array
284284
'create_key_values_table',
285285
'create_custom_spatie_permission_table',
286286
'update_sessions_table',
287+
'update_notification_table_for_uuid_users',
287288
];
288289
}
289290

0 commit comments

Comments
 (0)