Răsfoiți Sursa

Update SiteController

Daniel Supernault 6 ani în urmă
părinte
comite
c41e6a761d
1 a modificat fișierele cu 5 adăugiri și 8 ștergeri
  1. 5 8
      app/Http/Controllers/SiteController.php

+ 5 - 8
app/Http/Controllers/SiteController.php

@@ -33,18 +33,14 @@ class SiteController extends Controller
     {
         $pid = Auth::user()->profile->id;
         // TODO: Use redis for timelines
-        $following = Cache::rememberForever("user:following:list:$pid", function() use($pid) {
-          $following = Follower::whereProfileId($pid)->pluck('following_id');
-          $following->push($pid);
-          return $following->toArray();
-        });
 
-        $filtered = Cache::rememberForever("user:filter:list:$pid", function() use($pid) {
-          return UserFilter::whereUserId($pid)
+        $following = Follower::whereProfileId($pid)->pluck('following_id');
+        $following->push($pid)->toArray();
+
+        $filtered = UserFilter::whereUserId($pid)
                     ->whereFilterableType('App\Profile')
                     ->whereIn('filter_type', ['mute', 'block'])
                     ->pluck('filterable_id')->toArray();
-        });
 
         $timeline = Status::whereIn('profile_id', $following)
                   ->whereNotIn('profile_id', $filtered)
@@ -53,6 +49,7 @@ class SiteController extends Controller
                   ->orderBy('created_at', 'desc')
                   ->withCount(['comments', 'likes', 'shares'])
                   ->simplePaginate(20);
+                  
         $type = 'personal';
 
         return view('timeline.template', compact('timeline', 'type'));