/** * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View */ public function show(Request $request) { $questions = ProfileQuestion::join('profiles_answers', 'profiles_questions.id', '=', 'profiles_answers.profile_question_id')->where('profiles_answers.user_id', $request->id)->get(); $user = User::with('achievements')->where('users.id', $request->id)->first(); //$users = User::where('category_id', 2)->where('id', '<>', Auth::user()->id)->get(); return view('members/show', ['user' => $user, 'questions' => $questions]); }
/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function about() { $questions = ProfileQuestion::join('profiles_answers', 'profiles_questions.id', '=', 'profiles_answers.profile_question_id')->where('profiles_answers.user_id', Auth::user()->id)->get(); return view('profile.about', ['questions' => $questions]); }