original_string: protected function shouldAttributeBeFilterable(ModelAttributeDataInterface $attribute)
      {
          // If an attribute is a foreign key, it shouldn't be a filter by default.
  
          foreach ($this->info->relations as $key => $relation) {
  
              switch ($relation->type) {
  
                  case RelationType::MORPH_TO:
                  case RelationType::BELONGS_TO:
                  case RelationType::BELONGS_TO_THROUGH:
  
                      $keys = $relation->foreign_keys ?: [];
  
                      if (in_array($attribute->name, $keys)) {
                          return false;
                      }
                      break;
              }
          }
  
          return true;
      }
code: protected function shouldAttributeBeFilterable(ModelAttributeDataInterface $attribute)
      {
          // If an attribute is a foreign key, it shouldn't be a filter by default.
  
          foreach ($this->info->relations as $key => $relation) {
  
              switch ($relation->type) {
  
                  case RelationType::MORPH_TO:
                  case RelationType::BELONGS_TO:
                  case RelationType::BELONGS_TO_THROUGH:
  
                      $keys = $relation->foreign_keys ?: [];
  
                      if (in_array($attribute->name, $keys)) {
                          return false;
                      }
                      break;
              }
          }
  
          return true;
      }
code_tokens: protected function shouldAttributeBeFilterable ( ModelAttributeDataInterface $ attribute ) { // If an attribute is a foreign key, it shouldn't be a filter by default. foreach ( $ this -> info -> relations as $ key => $ relation ) { switch ( $ relation -> type ) { case RelationType :: MORPH_TO : case RelationType :: BELONGS_TO : case RelationType :: BELONGS_TO_THROUGH : $ keys = $ relation -> foreign_keys ? : [ ] ; if ( in_array ( $ attribute -> name , $ keys ) ) { return false ; } break ; } } return true ; }
docstring: Returns whether a given attribute should be filterable by default.
  
  @param ModelAttributeDataInterface|ModelAttributeData $attribute
  @return bool
docstring_tokens: Returns whether a given attribute should be filterable by default .