classes/Models/Base.php
public function titleAttributes()
    {
        // Convert to an array so I can test for the presence of values. As an
        // object, it would throw exceptions
        $row = $this->getAttributes();

         // Name before title to cover the case of people with job titles
        if (isset($row['name'])) {
            return ['name'];
        }

        // Search full names if people-type fields
        if (isset($row['first_name']) && isset($row['last_name'])) {
            return ['first_name', 'last_name'];
        }

        // Standard location for the title
        if (isset($row['title'])) {
            return ['title'];
        }

        // Default to no searchable attributes
        return [];
    }
public function titleAttributes()
    {
        // Convert to an array so I can test for the presence of values. As an
        // object, it would throw exceptions
        $row = $this->getAttributes();

         // Name before title to cover the case of people with job titles
        if (isset($row['name'])) {
            return ['name'];
        }

        // Search full names if people-type fields
        if (isset($row['first_name']) && isset($row['last_name'])) {
            return ['first_name', 'last_name'];
        }

        // Standard location for the title
        if (isset($row['title'])) {
            return ['title'];
        }

        // Default to no searchable attributes
        return [];
    }
public function titleAttributes ( ) { // Convert to an array so I can test for the presence of values. As an // object, it would throw exceptions $ row = $ this -> getAttributes ( ) ; // Name before title to cover the case of people with job titles if ( isset ( $ row [ 'name' ] ) ) { return [ 'name' ] ; } // Search full names if people-type fields if ( isset ( $ row [ 'first_name' ] ) && isset ( $ row [ 'last_name' ] ) ) { return [ 'first_name' , 'last_name' ] ; } // Standard location for the title if ( isset ( $ row [ 'title' ] ) ) { return [ 'title' ] ; } // Default to no searchable attributes return [ ] ; }
Deduce the source for the title of the model

@return array
Deduce the source for the title of the model