Skip to content

Commit

Permalink
check no dbal
Browse files Browse the repository at this point in the history
  • Loading branch information
romalytvynenko committed Mar 9, 2024
1 parent b03e99e commit b33c66a
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 115 deletions.
1 change: 0 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
"spatie/laravel-package-tools": "^1.9.2"
},
"require-dev": {
"doctrine/dbal": "^3.4",
"laravel/pint": "^v1.1.0",
"nunomaduro/collision": "^7.0|^8.0",
"orchestra/testbench": "^8.0|^9.0",
Expand Down
18 changes: 2 additions & 16 deletions src/Support/ResponseExtractor/ModelInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,9 @@ public function type()
*/
protected function getAttributes($model)
{
$driver = $this->makeDriver($model);
$provider = new NativeProvider();

$attributes = collect($driver->getAttributes($model))
$attributes = collect($provider->getAttributes($model))
->map(function (array $attribute) use ($model) {
$attribute['hidden'] = $this->attributeIsHidden($attribute['name'], $model);
$attribute['cast'] = $this->getCastType($attribute['name'], $model);
Expand All @@ -171,20 +171,6 @@ protected function getAttributes($model)
->keyBy('name');
}

/**
* @param \Illuminate\Database\Eloquent\Model $model
*/
private function makeDriver($model): ModelInfoProvider
{
$schema = $model->getConnection()->getSchemaBuilder();

if (method_exists($schema, 'getColumns')) {
return new NativeProvider();
}

return new DoctrineProvider();
}

/**
* Get the virtual (non-column) attributes for the given model.
*
Expand Down

This file was deleted.

0 comments on commit b33c66a

Please sign in to comment.