Skip to content

Commit

Permalink
Fix queue export
Browse files Browse the repository at this point in the history
  • Loading branch information
luanfreitasdev committed Dec 23, 2024
1 parent 517b57d commit 361a4fe
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
6 changes: 5 additions & 1 deletion src/DataSource/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@ public static function make(

public function filter(): EloquentBuilder|QueryBuilder
{
$filters = collect($this->component->filters);
$filters = collect(
app()->runningInConsole()
? $this->component->filters
: $this->component->filters()
);

if ($filters->isEmpty()) {
return $this->query;
Expand Down
18 changes: 10 additions & 8 deletions src/Traits/WithExport.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,19 @@ public function getExportBatchProperty(): ?Batch

public function updateExportProgress(): void
{
if (!is_null($this->exportBatch)) {
$this->batchFinished = $this->exportBatch->finished();
$this->batchProgress = $this->exportBatch->progress();
$this->batchErrors = $this->exportBatch->hasFailures();
if (is_null($this->exportBatch)) {
return;
}

if ($this->batchFinished) {
$this->batchExporting = false;
}
$this->batchFinished = $this->exportBatch->finished();
$this->batchProgress = $this->exportBatch->progress();
$this->batchErrors = $this->exportBatch->hasFailures();

$this->onBatchExecuting($this->exportBatch);
if ($this->batchFinished) {
$this->batchExporting = false;
}

$this->onBatchExecuting($this->exportBatch);
}

public function downloadExport(string $file): BinaryFileResponse
Expand Down

0 comments on commit 361a4fe

Please sign in to comment.