Skip to content

Commit

Permalink
Fix Illuminate\Support\Carbon instance in queue
Browse files Browse the repository at this point in the history
  • Loading branch information
luanfreitasdev committed May 11, 2024
1 parent 10a51a7 commit 48c39ef
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 46 deletions.
4 changes: 2 additions & 2 deletions src/Concerns/Filter.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ public function datePickerChanged(

$this->addEnabledFilters($field, $label);

$this->filters[$type][$field]['start'] = $startDate;
$this->filters[$type][$field]['end'] = $endDate;
$this->filters[$type][$field]['start'] = $startDate->toString();
$this->filters[$type][$field]['end'] = $endDate->toString();

$this->filters[$type][$field]['formatted'] = $dateStr;

Expand Down
23 changes: 0 additions & 23 deletions src/Exceptions/MissionExportablePackage.php

This file was deleted.

24 changes: 3 additions & 21 deletions src/Traits/WithExport.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
use PowerComponents\LivewirePowerGrid\Components\Exports\Export;
use PowerComponents\LivewirePowerGrid\DataSource\Builder;
use PowerComponents\LivewirePowerGrid\Jobs\ExportJob;
use PowerComponents\LivewirePowerGrid\{Exceptions\MissionExportablePackage, Exportable, ProcessDataSource};
use PowerComponents\LivewirePowerGrid\{Exportable, ProcessDataSource};
use Symfony\Component\HttpFoundation\BinaryFileResponse;
use Throwable;

Expand Down Expand Up @@ -198,32 +198,14 @@ public function prepareToExport(bool $selected = false): Eloquent\Collection|Sup
return $processDataSource->transform($results, $processDataSource->component);
}

/**
* @throws Throwable
*/
public function exportToXLS(bool $selected = false): BinaryFileResponse|bool
{
try {
return $this->export(Exportable::TYPE_XLS, $selected);
} catch (\Error) {
$package = config('livewire-powergrid.exportable.default');

throw new MissionExportablePackage($package);
}
return $this->export(Exportable::TYPE_XLS, $selected);
}

/**
* @throws Throwable
*/
public function exportToCsv(bool $selected = false): BinaryFileResponse|bool
{
try {
return $this->export(Exportable::TYPE_CSV, $selected);
} catch (\Error) {
$package = config('livewire-powergrid.exportable.default');

throw new MissionExportablePackage($package);
}
return $this->export(Exportable::TYPE_CSV, $selected);
}

/**
Expand Down

0 comments on commit 48c39ef

Please sign in to comment.