Added Notifications

This commit is contained in:
2026-05-19 21:45:24 +10:00
parent 3bd2bda84c
commit 3eb3971d79
202 changed files with 90 additions and 15 deletions
+9
View File
@@ -3,6 +3,7 @@
namespace App\Http\Controllers;
use App\Models\Followee;
use App\Models\Notification;
use App\Models\User;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\RedirectResponse;
@@ -26,6 +27,14 @@ class UserController extends Controller
'followee_id' => $user->id,
]);
Notification::create([
'user_id' => $user->id,
'title' => 'New follower',
'body' => auth()->user()->name . ' is now following you.',
'is_achievement' => false,
'url' => '/u/'. auth()->user()->name,
]);
return response()->json(['following' => true]);
}
}