<?php namespace App\Http\Controllers;

use Topic;
use Discussion;
use Illuminate\Http\Request;
use App\Filters\DiscussionFilters;

class TopicsController extends Controller
{
	public function __construct()
	{
		parent::__construct();
	}
	
	public function discussions(Topic $topic, DiscussionFilters $filters)
	{
		$discussions = Discussion::latest()->filter($filters);

		if ($topic->exists) {
			$discussions->where('topic_id', $topic->id);
		}

		$discussions = $discussions->get();

		return view('pages.discussions.index', compact('discussions'));
	}
}

<?php namespace App\Http\Controllers;

use Topic;
use Discussion;
use Illuminate\Http\Request;

class TopicsController extends Controller
{
	public function __construct()
	{
		parent::__construct();
	}
		if ($topic->exists) {
			$discussions = $topic->discussions()->latest()->get();
		} else {
			$discussions = Discussion::latest()->get();
		}

		return view('pages.discussions.index', compact('discussions'));
	}
}

--- 
+++ 
@@ -3,6 +3,7 @@
 use Topic;
 use Discussion;
 use Illuminate\Http\Request;
+use App\Filters\DiscussionFilters;
 
 class TopicsController extends Controller
 {
@@ -10,11 +11,16 @@
 	{
 		parent::__construct();
 	}
+	
+	public function discussions(Topic $topic, DiscussionFilters $filters)
+	{
+		$discussions = Discussion::latest()->filter($filters);
+
 		if ($topic->exists) {
-			$discussions = $topic->discussions()->latest()->get();
-		} else {
-			$discussions = Discussion::latest()->get();
+			$discussions->where('topic_id', $topic->id);
 		}
+
+		$discussions = $discussions->get();
 
 		return view('pages.discussions.index', compact('discussions'));
 	}
Add filters to topics controller
