@Tray2
ah, that's will bring us back to the first point which is the code snippet for all screens tables. with additional relations based on the user filter.
I have managed to solve the problem by taking the selected ids and then using the query builder and exporting it directly to .xlsx with the same performance.
Thanks in advance for your help.
\DB::table('transactions')
->leftJoin('kyc as sender_kyc','sender_kyc.account_id','=','transactions.source_account_id')
->leftJoin('kyc as target_kyc','target_kyc.account_id','=','transactions.target_account_id')
->leftJoin('groups as sender_group','sender_group.id','=','transactions.source_group_id')
->leftJoin('groups as target_group','target_group.id','=','transactions.target_group_id')
->leftJoin('currencies as currency','currency.id','=','transactions.currency_id')
->leftJoin('transaction_types','transaction_types.id','=','transactions.transaction_type_id')
->select([
'transactions.id',
'sender_kyc.family_name as sender_family_name',
'target_kyc.first_name as target_first_name',
'target_kyc.family_name as target_family_name',
'sender_group.name->ar as sender_group_name',
'target_group.name->ar as target_group_name',
'transaction_types.name->ar as transaction_type_name','])
->whereIn('transactions.id', $this->ids);
FastExcel::data($this->rowsGenerator($rawQuerey)))->export('public/test.xlsx');