We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 2c67b53 + 7927660 commit 90795e2Copy full SHA for 90795e2
src/Exports/ExcelExport.php
@@ -189,10 +189,14 @@ public function getModelClass(): ?string
189
return $this->model;
190
}
191
192
- if (($resource = $this->getResourceClass()) !== null) {
+ $table = $this->getLivewire()->getTable();
193
+
194
+ if (($relationship = $table->getRelationship()) !== null) {
195
+ $model = get_class($relationship->getRelated());
196
+ } elseif (($resource = $this->getResourceClass()) !== null) {
197
$model = $resource::getModel();
- } elseif (($livewire = $this->getLivewire()) instanceof HasTable) {
- $model = $livewire->getTable()->getModel();
198
+ } else {
199
+ $model = $table->getModel();
200
201
202
return $this->model ??= $model;
0 commit comments