/**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index($idForum, $idTopic)
 {
     //
     $ajouter = false;
     $forum = ForumForum::findOrFail($idForum);
     $topic = ForumTopic::findOrFail($idTopic);
     $posts = ForumPost::where('forum_topic_id', '=', $idTopic)->orderBy('created_at')->paginate(10);
     // tester autorisation d'ajout
     if (Auth::user() != NULL) {
         if (Auth::user()->rang()->first()->getId() >= $forum->getPermissionPost() && $topic->getGenreId() != 2) {
             $ajouter = true;
         }
     }
     foreach ($posts as $post) {
         $post->setTexte(str_replace('<script', '', $post->getTexte()));
         $post->setTexte(str_replace('</script', '', $post->getTexte()));
         $post->setTexte(str_replace('<div', '', $post->getTexte()));
         $post->setTexte(str_replace('</div', '', $post->getTexte()));
     }
     return view('forum.posts')->with(compact('topic', 'forum', 'posts', 'ajouter', 'idForum', 'idTopic'));
 }