public function index()
 {
     // SON GÖNDERİLEN SORULARI ÇEKELİM
     $lastQuestions = Questions::with('user')->orderBy('id', 'DESC')->take(5)->get();
     // EN SON CEVAP YAZILAN SORULARI ÇEKELİM
     $lastComments = Comments::with('user', 'questions')->orderBy('id', 'DESC')->take(5)->get();
     // VIEW'İ ÇALIŞTIRALIM
     return View::make('home/index', compact('lastQuestions', 'lastComments'));
 }
 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'));
 }