Browse Source

Update User model, add notify_enabled

Daniel Supernault 9 months ago
parent
commit
141fc77be9

+ 1 - 1
app/User.php

@@ -9,7 +9,6 @@ use Illuminate\Database\Eloquent\SoftDeletes;
 use Illuminate\Foundation\Auth\User as Authenticatable;
 use Illuminate\Foundation\Auth\User as Authenticatable;
 use Illuminate\Notifications\Notifiable;
 use Illuminate\Notifications\Notifiable;
 use Laravel\Passport\HasApiTokens;
 use Laravel\Passport\HasApiTokens;
-use NotificationChannels\Expo\ExpoPushToken;
 use NotificationChannels\WebPush\HasPushSubscriptions;
 use NotificationChannels\WebPush\HasPushSubscriptions;
 
 
 class User extends Authenticatable
 class User extends Authenticatable
@@ -46,6 +45,7 @@ class User extends Authenticatable
         'last_active_at',
         'last_active_at',
         'register_source',
         'register_source',
         'expo_token',
         'expo_token',
+        'notify_enabled',
         'notify_like',
         'notify_like',
         'notify_follow',
         'notify_follow',
         'notify_mention',
         'notify_mention',

+ 28 - 0
database/migrations/2024_09_18_093322_add_notify_shares_to_users_table.php

@@ -0,0 +1,28 @@
+<?php
+
+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::table('users', function (Blueprint $table) {
+            $table->boolean('notify_enabled')->default(false);
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     */
+    public function down(): void
+    {
+        Schema::table('users', function (Blueprint $table) {
+            $table->dropColumn('notify_enabled');
+        });
+    }
+};