classes/Models/Traits/Exportable.php
public function makeCsvHeaderNames()
    {
        $headers = array_keys($this->forExport());
        return array_map(function($key) {
            switch($key) {

                // id must be lowercase for opening in excel
                // https://annalear.ca/2010/06/10/why-excel-thinks-your-csv-is-a-sylk/
                case 'id': return $key;

                // Make common acronyms upper case
                case 'uid':
                case 'pid':
                case 'guid':
                case 'cta':
                case 'url': return strtoupper($key);

                // Default to title casing fields
                default: return TextUtils::titleFromKey($key);
            }
        }, $headers);
    }
public function makeCsvHeaderNames()
    {
        $headers = array_keys($this->forExport());
        return array_map(function($key) {
            switch($key) {

                // id must be lowercase for opening in excel
                // https://annalear.ca/2010/06/10/why-excel-thinks-your-csv-is-a-sylk/
                case 'id': return $key;

                // Make common acronyms upper case
                case 'uid':
                case 'pid':
                case 'guid':
                case 'cta':
                case 'url': return strtoupper($key);

                // Default to title casing fields
                default: return TextUtils::titleFromKey($key);
            }
        }, $headers);
    }
public function makeCsvHeaderNames ( ) { $ headers = array_keys ( $ this -> forExport ( ) ) ; return array_map ( function ( $ key ) { switch ( $ key ) { // id must be lowercase for opening in excel // https://annalear.ca/2010/06/10/why-excel-thinks-your-csv-is-a-sylk/ case 'id' : return $ key ; // Make common acronyms upper case case 'uid' : case 'pid' : case 'guid' : case 'cta' : case 'url' : return strtoupper ( $ key ) ; // Default to title casing fields default : return TextUtils :: titleFromKey ( $ key ) ; } } , $ headers ) ; }
Make the header the CSV header row

@return array
Make the header the CSV header row