diff --git a/composer.json b/composer.json index f6006326b..378e0dfeb 100644 --- a/composer.json +++ b/composer.json @@ -30,7 +30,7 @@ }, "require": { "php": "^8.2", - "laravel/framework": "^10.0 || ^11.0", + "laravel/framework": "^10.34 || ^11.0", "mollie/mollie-api-php": "^2.30.0", "moneyphp/money": "^4.0", "paypal/paypal-checkout-sdk": "^1.0", diff --git a/src/Customers/EloquentCustomerRepository.php b/src/Customers/EloquentCustomerRepository.php index 9abaa8118..bfce495b8 100644 --- a/src/Customers/EloquentCustomerRepository.php +++ b/src/Customers/EloquentCustomerRepository.php @@ -150,16 +150,10 @@ public function delete(Customer $customer): void */ protected function getCustomColumns(): array { - $tableColumns = Schema::getConnection() - ->getDoctrineSchemaManager() - ->listTableColumns((new $this->model)->getTable()); - - return collect($tableColumns) - ->reject(function (Column $column) { - return in_array($column->getName(), $this->knownColumns); - }) - ->map->getName() - ->toArray(); + return collect(Schema::getColumns((new $this->model)->getTable())) + ->reject(fn (array $column) => in_array($column['name'], $this->knownColumns)) + ->map(fn (array $column) => $column['name']) + ->all(); } public static function bindings(): array diff --git a/src/Customers/EloquentQueryBuilder.php b/src/Customers/EloquentQueryBuilder.php index 21c9d32a3..e61d2684d 100644 --- a/src/Customers/EloquentQueryBuilder.php +++ b/src/Customers/EloquentQueryBuilder.php @@ -30,11 +30,9 @@ protected function column($column) protected function columnExists(string $column): bool { $databaseColumns = Blink::once("DatabaseColumns_{$this->builder->getModel()->getTable()}", function () { - $columns = Schema::getConnection() - ->getDoctrineSchemaManager() - ->listTableColumns($this->builder->getModel()->getTable()); - - return collect($columns)->map->getName()->values(); + return collect(Schema::getColumns($this->builder->getModel()->getTable())) + ->map(fn (array $column) => $column['name']) + ->all(); }); return $databaseColumns->contains($column); diff --git a/src/Orders/EloquentOrderRepository.php b/src/Orders/EloquentOrderRepository.php index 4e58a06fc..e5f71d7c1 100644 --- a/src/Orders/EloquentOrderRepository.php +++ b/src/Orders/EloquentOrderRepository.php @@ -257,16 +257,10 @@ public function delete($order): void */ protected function getCustomColumns(): array { - $tableColumns = Schema::getConnection() - ->getDoctrineSchemaManager() - ->listTableColumns((new $this->model)->getTable()); - - return collect($tableColumns) - ->reject(function (Column $column) { - return in_array($column->getName(), $this->knownColumns); - }) - ->map->getName() - ->toArray(); + return collect(Schema::getColumns((new $this->model)->getTable())) + ->reject(fn (array $column) => in_array($column['name'], $this->knownColumns)) + ->map(fn (array $column) => $column['name']) + ->all(); } /** diff --git a/src/Orders/EloquentQueryBuilder.php b/src/Orders/EloquentQueryBuilder.php index 812cbd234..c6babd173 100644 --- a/src/Orders/EloquentQueryBuilder.php +++ b/src/Orders/EloquentQueryBuilder.php @@ -77,11 +77,9 @@ public function whereStatusLogDate(OrderStatus|PaymentStatus $status, Carbon $da protected function columnExists(string $column): bool { $databaseColumns = Blink::once("DatabaseColumns_{$this->builder->getModel()->getTable()}", function () { - $columns = Schema::getConnection() - ->getDoctrineSchemaManager() - ->listTableColumns($this->builder->getModel()->getTable()); - - return collect($columns)->map->getName()->values(); + return collect(Schema::getColumns($this->builder->getModel()->getTable())) + ->map(fn (array $column) => $column['name']) + ->all(); }); return $databaseColumns->contains($column);