I am using this subscription package https://github.com/overtrue/laravel-subscribe , so i want to get thread (post) associated with the space a user has subscribe to
$spaces = Space::whereHas('subscribers', function($query){
$query->where('subscribable_id', '=', 'user_id');
})->with('thread')->orderBy('id', 'desc')->paginate(10);