Laravel bersemangat memuat di mana klausa
$query = ""
if ($request->has('country'){
$query = Post::with("country")->whereHas("country",function($q) use($request){
$q->where("name","=",$request->country);
})->get()
}else{
$query = Post::with("country")->get();
}
ssbrar