public function excel($filename, $data)
    {
        \Excel::create($filename, function ($excel) use ($filename, $data) {
            $excel->sheet($filename, function ($sheet) use ($data) {
                $sheet->fromArray($data);
            });
        })
              ->export('xlsx');
    }
public function excel($filename, $data)
    {
        \Excel::create($filename, function ($excel) use ($filename, $data) {
            $excel->sheet($filename, function ($sheet) use ($data) {
                $sheet->fromArray($data);
            });
        })
              ->export('xlsx');
    }
public function excel ( $ filename , $ data ) { \ Excel :: create ( $ filename , function ( $ excel ) use ( $ filename , $ data ) { $ excel -> sheet ( $ filename , function ( $ sheet ) use ( $ data ) { $ sheet -> fromArray ( $ data ) ; } ) ; } ) -> export ( 'xlsx' ) ; }
Export date to Excel file.

@param $filename
@param $data
Export date to Excel file .