Skip to content

Commit

Permalink
Merge pull request #112 from crynobone/patch-serialize-queries
Browse files Browse the repository at this point in the history
Support serializing relation when running `QueuedExport`.
  • Loading branch information
patrickbrouwers authored Apr 19, 2021
2 parents 12a696e + 51e83d8 commit ac64c0a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"require": {
"php": ">=7.1.0",
"laravel/nova": "*",
"laravie/serialize-queries": "^0.2",
"laravie/serialize-queries": "^0.3",
"maatwebsite/excel": "^3.1"
},
"autoload": {
Expand Down
3 changes: 2 additions & 1 deletion src/Actions/QueuedExport.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Database\Eloquent\Builder as QueryBuilder;
use Illuminate\Database\Eloquent\Relations\Relation;
use Laravel\Nova\Nova;
use Laravie\SerializesQuery\Eloquent;
use Maatwebsite\LaravelNovaExcel\Requests\SerializedRequest;
Expand All @@ -24,7 +25,7 @@ public function __sleep()
$this->request = SerializedRequest::serialize($this->request);
}

if ($this->query instanceof QueryBuilder) {
if ($this->query instanceof QueryBuilder || $this->query instanceof Relation) {
$this->query = Eloquent::serialize($this->query);
}

Expand Down

0 comments on commit ac64c0a

Please sign in to comment.