vdomah / octoexcel

OctoberCMS wrapper for Maatwebsite/Laravel-Excel
MIT License
14 stars 10 forks source link

export file type #12

Closed bkrajendra closed 4 years ago

bkrajendra commented 4 years ago

can we just add more file type to following array to get it working?

    public static function export($class, $filename, $type = 'csv')
    {
        if (! in_array($type, ['xls', 'csv'])) {
            $type = 'csv';
        }

        $fn = $filename;

        return self::excel()->download(new $class, $fn.'.'.$type);
    }

why its only limited to ['xls', 'csv'] can we just allow whats passed as an argument from exportmethod?

I guess it does support many types

vdomah commented 4 years ago

yes, you're right. Will do that