Skip to content

Export circular relationship #167

Answered by scajal
scajal asked this question in Q&A
Jan 2, 2024 · 2 comments · 1 reply
Discussion options

You must be logged in to vote

@pxlrbt the where is being added here:


I suppose that's because it's inside a relationship.

Anyway, I solved it by overriding the export method of the pxlrbt\FilamentExcel\Exports\ExcelExport class and removing the where before making the export (implementing a custom closure):

public function export()
{
    if ($this->modifyQueryBeforeExportUsing) {
        app()->call($this->modifyQueryBeforeExportUsing->getClosure(), [
            'query' => $this->getQuery(),
            'livewire' => $this->getLivewire(),
        ]);
    }

    return parent::export();
}

Then, I'd do:

\App\Filament\Pages\Actions\…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@pxlrbt
Comment options

Answer selected by pxlrbt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants