app/Exports/SurveyExport.php
/**
     * Add a heading row
     *
     * @return array
     */
Add a heading row
@return array
Add a heading row @return array
public function headings(): array
    {
        $keys = collect($this->results->first())->keys()->all();
        $headings = collect($keys)->map(function ($key) {
            return Repeatable::find(explode('-', $key)[1])->question;
        });
        return $headings->toArray();
    }
public function headings ( ) : array { $ keys = collect ( $ this -> results -> first ( ) ) -> keys ( ) -> all ( ) ; $ headings = collect ( $ keys ) -> map ( function ( $ key ) { return Repeatable :: find ( explode ( '-' , $ key ) [ 1 ] ) -> question ; } ) ; return $ headings -> toArray ( ) ; }
Add a heading row
 @return array
Add a heading row @return array