public function detail($id) { // SORUYU TABLODAN ÇEKELİM $question = Questions::with('user')->where('id', '=', $id)->orderBy('id', 'DESC')->first(); // EĞER SORU BULUNAMADIYSA YÖNLENDİRELİM if (!$question) { return Redirect::route('homePage'); } // SAĞ BÖLÜM İÇİN RASTGELE SORULAR ÇEKELİM $randomQuestions = Questions::take(3)->orderBy(DB::raw('RAND()'))->get(); // GÖNDERİLEN YANITLARI ÇEKELİM $comments = Comments::with('user')->where('question_id', '=', $id)->get(); // VIEW'İ ÇALIŞTIRALIM return View::make('questions.detail', compact('question', 'randomQuestions', 'comments')); }