Closed marcelloinfoweb closed 3 years ago
I solved it with "if"
if (isset($searchResults[0]['AS_Sistemas_Chat'])) {
$chats = AssistemasChatQuery::whereIn('id', $searchResults[0]['AS_Sistemas_Chat'])->get();
} else {
$chats = [];
}
if (isset($searchResults[0]['Agromidia_Helpdesk'])) {
$helps = AgromidiaHelpdeskQuery::whereIn('id', $searchResults[0]['Agromidia_Helpdesk'])->get();
} else {
$helps = [];
}
$sheets = new SheetCollection([
$chats,
$helps,
]);
return (new FastExcel($sheets))->download('file.csv');
Pass multiple variables with array for collection.
Erro Message:
ErrorException Undefined variable: chats