fixed import has row model relation issue

This commit is contained in:
Cihan Şentürk 2024-01-02 17:52:04 +03:00 committed by GitHub
parent 3af29e9c38
commit a014c3d1bf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -234,10 +234,12 @@ abstract class Import implements HasLocalePreference, ShouldQueue, SkipsEmptyRow
// This query should be used if there is no deleted_at field in the table or if the deleted data is to be retrieved.
return $this->model::withTrashed()->get($this->columns)->each(function ($data) {
$data->setAppends([]);
$data->unsetRelations();
});
} else {
return $this->model::get($this->columns)->each(function ($data) {
$data->setAppends([]);
$data->unsetRelations();
});
}
});