2019-06-11 02:14:02 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Http\Controllers\Settings;
|
|
|
|
|
|
|
|
use App\AccountLog;
|
|
|
|
use App\EmailVerification;
|
|
|
|
use App\Instance;
|
|
|
|
use App\Media;
|
|
|
|
use App\Profile;
|
|
|
|
use App\User;
|
|
|
|
use App\UserFilter;
|
|
|
|
use App\Util\Lexer\PrettyNumber;
|
|
|
|
use Auth, Cache, DB;
|
|
|
|
use Illuminate\Http\Request;
|
|
|
|
|
|
|
|
trait RelationshipSettings
|
|
|
|
{
|
|
|
|
|
2019-06-16 23:38:23 +00:00
|
|
|
public function relationshipsHome(Request $request)
|
2019-06-11 02:14:02 +00:00
|
|
|
{
|
2019-06-16 23:38:23 +00:00
|
|
|
$mode = $request->input('mode') == 'following' ? 'following' : 'followers';
|
2019-06-13 01:10:45 +00:00
|
|
|
$profile = Auth::user()->profile;
|
|
|
|
|
2019-06-16 23:38:23 +00:00
|
|
|
$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'));
|
2019-06-11 02:14:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|