So basically got laravel project and got to export tables in excel. I'm using this for the export. Till now i only export from array or in my case.
public function exportGames()
{
$export = Games::all();
Excel::create('Games Data', function($excel) use($export){
$excel->sheet('Games', function($sheet) use($export){
$sheet->fromArray($export);
});
})->export('xlsx');
}
This however returns full table data, which include some field I to be gone (timestamps etc.). Also relational tables is not possible to display (only in the actual table on the page). Spend hours in the documentation still don't understand how to do it. Wanna rip my hair off. How do modify columns to export. Thanks in advice.