Skip to content
Discussion options

You must be logged in to vote

This is a bit misguided. $this->resource would not be available in the closure. The only place where the resource ids available once in the closure are in the $query. It's probably best to leftJoin() the existing query in the attempted example above.

ExportAsCsv::make('Export All Comments')
    ->sole()
    ->withQuery(fn ($query) => $query->leftJoin('comments', 'comments.post_id', '=', 'post.id')); // or some such

Please ignore / delete.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by k8n
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant