Browse Source

Update AccountController

Daniel Supernault 6 years ago
parent
commit
6e798f3f75
1 changed files with 3 additions and 1 deletions
  1. 3 1
      app/Http/Controllers/AccountController.php

+ 3 - 1
app/Http/Controllers/AccountController.php

@@ -64,10 +64,12 @@ class AccountController extends Controller
       ]);
       ]);
         $profile = Auth::user()->profile;
         $profile = Auth::user()->profile;
         $action = $request->input('a');
         $action = $request->input('a');
+        $allowed = ['like', 'follow'];
         $timeago = Carbon::now()->subMonths(3);
         $timeago = Carbon::now()->subMonths(3);
         $following = $profile->following->pluck('id');
         $following = $profile->following->pluck('id');
         $notifications = Notification::whereIn('actor_id', $following)
         $notifications = Notification::whereIn('actor_id', $following)
-          ->where('profile_id', '!=', $profile->id)
+          ->whereIn('action', $allowed)
+          ->where('actor_id', '<>', $profile->id)
           ->whereDate('created_at', '>', $timeago)
           ->whereDate('created_at', '>', $timeago)
           ->orderBy('notifications.created_at', 'desc')
           ->orderBy('notifications.created_at', 'desc')
           ->simplePaginate(30);
           ->simplePaginate(30);