I'm using maatwebsite/excel package and I would like to dynamically pass different file type as a second parameter.
See function here
Below is the variable:
$fileType = $request->input('fileType', 'xlsx');
$writerType = Excel::$fileType;
But I get the error:
Access to undeclared static property: Maatwebsite\Excel\Excel::$fileType
I try to use curly brackets but doesn't work:
Excel::${"fileType"};
How do I pass the variable? Thanks!