src/Traits/HasCountry.php
public function scopeByCountry( $query, $id )
    {
        return $query->whereHas('country', function($q) use($id) {
            $q->where('id', $id);
        });
    }
public function scopeByCountry( $query, $id )
    {
        return $query->whereHas('country', function($q) use($id) {
            $q->where('id', $id);
        });
    }
public function scopeByCountry ( $ query , $ id ) { return $ query -> whereHas ( 'country' , function ( $ q ) use ( $ id ) { $ q -> where ( 'id' , $ id ) ; } ) ; }
Scope by country.

@param  object   $query
@param  integer  $id
@return mixed
Scope by country .