Merge pull request #108 from m4sk1n/discover-fix

Do not recommend myself
pull/86/head^2
daniel 2018-06-01 16:46:30 -06:00 zatwierdzone przez GitHub
commit 619d51060f
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 2 dodań i 2 usunięć

Wyświetl plik

@ -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'));
}