slug() !== $username) { abort(404); } if ($request->user()?->cannot('view', $user)) { abort(403); } // not sure if this is optimal. Some way to do $user->with(...) ??? $user = User::where('id', $user->id) ->with(['followers', 'following']) ->firstOrFail(); return view('user.show', compact('user')); } }