SpartnerNL / Laravel-Excel

🚀 Supercharged Excel exports and imports in Laravel
https://laravel-excel.com
MIT License
12.29k stars 1.92k forks source link

[Using ToCollection options requires database?] #2767

Closed gilsedawk closed 3 years ago

gilsedawk commented 4 years ago

Prerequisites

Versions

Description

When i use the toCollection option i get a database connection error: Doctrine\DBAL\Driver\PDOException : SQLSTATE[HY000] [1045] Access denied for user 'forge'@'localhost' (using password: NO)

I don't use a database so that explains the error but that's why i chose not to use the toModel option but the toCollection option.

why is the latter using a database connection?

all i want is the excel reader to import the excel file to collection so i can then submit the collection to a remote API (and not local database)

is this by design or a bug?

and if it is by design, then whta's the purpose of the toModel option?

bit confused.

Additional Information

patrickbrouwers commented 4 years ago

You probably have to disable the transactions: https://github.com/Maatwebsite/Laravel-Excel/blob/3.1/config/excel.php#L152

gilsedawk commented 4 years ago

ah, that explains. thx

stale[bot] commented 3 years ago

This bug report has been automatically closed because it has not had recent activity. If this is still an active bug, please comment to reopen. Thank you for your contributions.