Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom CSV Settings #71

Open
mackhankins opened this issue Apr 18, 2023 · 6 comments
Open

Custom CSV Settings #71

mackhankins opened this issue Apr 18, 2023 · 6 comments
Labels
help wanted Extra attention is needed

Comments

@mackhankins
Copy link
Contributor

Would it be possible to support these in a future version?

https://docs.laravel-excel.com/3.1/exports/settings.html#custom-csv-settings

@pxlrbt
Copy link
Owner

pxlrbt commented Apr 20, 2023

I haven't used CSV export yet, but it should be easy to add.

@pxlrbt pxlrbt added the help wanted Extra attention is needed label May 23, 2023
@SDJeff
Copy link

SDJeff commented Aug 25, 2023

Would be great if that can implemented

@pxlrbt
Copy link
Owner

pxlrbt commented Aug 26, 2023

Curious on which settings you are interested in? All of them? Do you want to set these per Export? Or why don't you overwrite the config file?

@SDJeff
Copy link

SDJeff commented Aug 27, 2023

Just need a simple TXT File Values TAB separated. For example:

->withCustomCsvSettings(
        [
            'delimiter' => '\t',
            'use_bom' => false,
            'output_encoding' => 'ISO-8859-1',
        ];
)

@rasmustaarnby
Copy link

rasmustaarnby commented Sep 4, 2023

@SDJeff I just ran into the same issue.

I'm using this quick and dirty trick to overwrite the config on the fly.

FilamentExcel\Actions\Tables\ExportBulkAction::make()
    ->before(function () {
        config(
            [
                'excel.exports.csv' => [
                    'delimiter' => '\t',
                    'enclosure' => '',
                ]
            ]
        );
    })

Update:
We have one download action that needs a different format than all other CSV downloads, which is why it would be nice to control it per export action.

@SDJeff
Copy link

SDJeff commented Sep 12, 2023

Check! Works like mentioned! Could be a workaround! Thx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants