GETTING ALL THE CATEGORY WITH ITS CHANNELS WHERE CATEGORY SLUG = ANIMAL

Category::with(['channels'])->where('slug', 'animal')->get();

GETTING ALL THE CATEGORY WITH ITS CHANNELS WHERE HAS A CHANNEL SLUG = ANIMAL

Category::with(['channels'])->whereHas('channels'=>function($q){
    $q->where('slug','animal');
})->get();

GETTING ALL THE CATEGORY WITH ONLY CHANNELS THAT HAS A SLUG = ANIMAL

Category::with(['channels'=>function($q){
    $q->where('slug','animal');
}])->get();