RelationshipSettings.php 738 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. namespace App\Http\Controllers\Settings;
  3. use App\AccountLog;
  4. use App\EmailVerification;
  5. use App\Instance;
  6. use App\Media;
  7. use App\Profile;
  8. use App\User;
  9. use App\UserFilter;
  10. use App\Util\Lexer\PrettyNumber;
  11. use Auth, Cache, DB;
  12. use Illuminate\Http\Request;
  13. trait RelationshipSettings
  14. {
  15. public function relationshipsHome(Request $request)
  16. {
  17. $mode = $request->input('mode') == 'following' ? 'following' : 'followers';
  18. $profile = Auth::user()->profile;
  19. $following = $followers = [];
  20. if($mode == 'following') {
  21. $data = $profile->following()->simplePaginate(10);
  22. } else {
  23. $data = $profile->followers()->simplePaginate(10);
  24. }
  25. return view('settings.relationships.home', compact('profile', 'mode', 'data'));
  26. }
  27. }