# GameLog Feature Batch Implementation Plan > **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking. **Goal:** Add follow system, activity feed, notifications, sitemap, Scout search, and caching to the GameLog Laravel 11 app. **Architecture:** All features hook into existing User/Game/UserGame/Review models. Migrations for follows/activities already ran. The nav (layouts/app.blade.php) handles all global UI additions. Scout uses the `database` driver for dev (SQLite). **Tech Stack:** Laravel 13 + Tailwind + Alpine.js, SQLite dev, spatie/laravel-sitemap, laravel/scout --- ### Task 1: FollowController + Routes **Files:** - Create: `app/Http/Controllers/FollowController.php` - Modify: `routes/web.php` - [ ] Create FollowController with store/destroy returning JSON ```php user(); if ($me->id === $user->id) { return response()->json(['error' => 'Cannot follow yourself'], 422); } if (!$me->following()->where('following_id', $user->id)->exists()) { $me->following()->attach($user->id); $user->notifications()->create([ 'id' => \Illuminate\Support\Str::uuid(), 'type' => 'new_follower', 'data' => json_encode([ 'follower_id' => $me->id, 'follower_username' => $me->username, 'follower_name' => $me->name, ]), ]); } return response()->json([ 'following' => true, 'count' => $user->followers()->count(), ]); } public function destroy(User $user): JsonResponse { auth()->user()->following()->detach($user->id); return response()->json([ 'following' => false, 'count' => $user->followers()->count(), ]); } } ``` - [ ] Add routes to web.php (auth group) ```php Route::middleware('auth')->group(function () { Route::post('/users/{user:username}/follow', [\App\Http\Controllers\FollowController::class, 'store'])->name('users.follow'); Route::delete('/users/{user:username}/follow', [\App\Http\Controllers\FollowController::class, 'destroy'])->name('users.unfollow'); }); ``` - [ ] Commit: `git commit -m "feat: add FollowController and routes"` --- ### Task 2: Notifications Migration + Model **Files:** - Create: `database/migrations/2026_05_30_000001_create_notifications_table.php` - Create: `app/Models/Notification.php` - [ ] Create notifications migration ```php uuid('id')->primary(); $table->foreignId('user_id')->constrained()->cascadeOnDelete(); $table->string('type', 100); $table->json('data'); $table->timestamp('read_at')->nullable(); $table->timestamp('created_at')->nullable(); }); } public function down(): void { Schema::dropIfExists('notifications'); } }; ``` - [ ] Create Notification model ```php 'array', 'read_at' => 'datetime', 'created_at' => 'datetime']; public function user(): BelongsTo { return $this->belongsTo(User::class); } } ``` - [ ] Run migration: `php artisan migrate` - [ ] Commit: `git commit -m "feat: add notifications table and model"` --- ### Task 3: Follow Button on users/show.blade.php **Files:** - Modify: `resources/views/users/show.blade.php` - [ ] Add Alpine.js follow button block after `