Skip to content

Commit 2195228

Browse files
committed
fix: previous commit 1aabe7e didn't handle all Laravel versions
1 parent 1aabe7e commit 2195228

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/Schema/BuilderWipe.php

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,14 @@ private function findRelations(Collection $relations, array $exclude = []): arra
7979
{
8080
$excludedRelations = array_merge($this->connection->getConfig('dont_drop') ?? [], $exclude);
8181

82-
return array_filter(
83-
array: $this->connection->getPostProcessor()->processTables($relations->all()),
84-
callback: function ($relation) use ($excludedRelations) {
85-
return blank(array_intersect([$relation['name'], $relation['schema_qualified_name']], $excludedRelations));
86-
}
87-
);
82+
$avilableRelations = array_map(fn ($relation) => [
83+
'name' => $relation->name,
84+
'schema_qualified_name' => "{$relation->schema}.{$relation->name}",
85+
], $relations->all());
86+
87+
return array_filter($avilableRelations, function ($relation) use ($excludedRelations) {
88+
return blank(array_intersect([$relation['name'], $relation['schema_qualified_name']], $excludedRelations));
89+
});
8890
}
8991

9092
/**

0 commit comments

Comments
 (0)