diff --git a/app/Http/Controllers/Settings/RelationshipSettings.php b/app/Http/Controllers/Settings/RelationshipSettings.php index a61e8b839..efc369fe6 100644 --- a/app/Http/Controllers/Settings/RelationshipSettings.php +++ b/app/Http/Controllers/Settings/RelationshipSettings.php @@ -16,13 +16,20 @@ use Illuminate\Http\Request; trait RelationshipSettings { - public function relationshipsHome() + public function relationshipsHome(Request $request) { + $mode = $request->input('mode') == 'following' ? 'following' : 'followers'; $profile = Auth::user()->profile; - $following = $profile->following()->simplePaginate(10); - $followers = $profile->followers()->simplePaginate(10); - return view('settings.relationships.home', compact('profile', 'following', 'followers')); + $following = $followers = []; + + if($mode == 'following') { + $data = $profile->following()->simplePaginate(10); + } else { + $data = $profile->followers()->simplePaginate(10); + } + + return view('settings.relationships.home', compact('profile', 'mode', 'data')); } } \ No newline at end of file diff --git a/resources/views/settings/relationships/home.blade.php b/resources/views/settings/relationships/home.blade.php index 1332e3f88..c4183534a 100644 --- a/resources/views/settings/relationships/home.blade.php +++ b/resources/views/settings/relationships/home.blade.php @@ -2,116 +2,118 @@ @section('section') -
You are not following anyone, or followed by anyone.
- @else -- - | -Username | -Relationship | -Action | -
---|---|---|---|
- {{-- --}} - | -- {{$follower->username}} - | -Follower | -- Mute - Block - | -
- - | -- {{$follower->username}} - | -Following | -- Unfollow - | -
You are not {{$mode == 'following' ? 'following anyone.' : 'followed by anyone.'}}
+@else + ++ + | +Username | +Relationship | +Action | +||
---|---|---|---|---|---|
+ {{-- --}} + | ++ + {{$follower->username}} + | + @if($mode == 'following') +Following | ++ Unfollow + | + @else +Follower | ++ Mute + Block + | + @endif +