public function scopeVisible($query, $languageSlug = '')
    {
        if(!$languageSlug) {
            $languageSlug = App::getLocale();
        }
        return $query->where('isVisible->'.$languageSlug, true);
    }
public function scopeVisible($query, $languageSlug = '')
    {
        if(!$languageSlug) {
            $languageSlug = App::getLocale();
        }
        return $query->where('isVisible->'.$languageSlug, true);
    }
public function scopeVisible ( $ query , $ languageSlug = '' ) { if ( ! $ languageSlug ) { $ languageSlug = App :: getLocale ( ) ; } return $ query -> where ( 'isVisible->' . $ languageSlug , true ) ; }
Scope a query to only include visible categories.

@param  string                                $languageSlug
@param  \Illuminate\Database\Eloquent\Builder $query
@return \Illuminate\Database\Eloquent\Builder
Scope a query to only include visible categories .