Преглед на файлове

Merge pull request #108 from m4sk1n/discover-fix

Do not recommend myself
daniel преди 7 години
родител
ревизия
619d51060f
променени са 1 файла, в които са добавени 2 реда и са изтрити 2 реда
  1. 2 2
      app/Http/Controllers/DiscoverController.php

+ 2 - 2
app/Http/Controllers/DiscoverController.php

@@ -16,8 +16,8 @@ class DiscoverController extends Controller
     public function home()
     {
       $following = Follower::whereProfileId(Auth::user()->profile->id)->pluck('following_id');
-      $people = Profile::inRandomOrder()->whereNotIn('id', $following)->take(3)->get();
-      $posts = Status::whereHas('media')->whereNotIn('profile_id', $following)->orderBy('created_at', 'desc')->take('21')->get();
+      $people = Profile::inRandomOrder()->where('id', '!=', Auth::user()->profile->id)->whereNotIn('id', $following)->take(3)->get();
+      $posts = Status::whereHas('media')->where('profile_id', '!=', Auth::user()->profile->id)->whereNotIn('profile_id', $following)->orderBy('created_at', 'desc')->take('21')->get();
       return view('discover.home', compact('people', 'posts'));
     }