PHPackages                             gsferro/database-schema-easy - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. gsferro/database-schema-easy

ActiveLibrary[Database &amp; ORM](/categories/database)

gsferro/database-schema-easy
============================

Simple and efficient way to manipulate your database connection scheme, whatever it may be.

v1.1.1(3y ago)0409↓50%1MITPHPPHP ^8.0

Since Mar 16Pushed 3y ago1 watchersCompare

[ Source](https://github.com/gsferro/eloquent-database-schema-easy)[ Packagist](https://packagist.org/packages/gsferro/database-schema-easy)[ RSS](/packages/gsferro-database-schema-easy/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (2)Versions (4)Used By (1)

[![Logo](logo.png)](logo.png)

Simple and efficient way to manipulate your database connection scheme, whatever it may be.

### Instalação:

[](#instalação)

```
composer require gsferro/database-schema-easy

```

### Dependências:

[](#dependências)

PackageVersãoPHP^8Laravel^8Doctrine/orm^2.14### Uso:

[](#uso)

- Instancie o serviço

    ```
    $schema = new DatabaseSchemaEasy(string $table, string $connection = null);

    ```
- Facade

    ```
    $schema = dbschemaeasy(string $table)

    ```

### Métodos:

[](#métodos)

- `hasTable(): bool`: Verifica se a table exists

    ```
    $schema->hasTable();
    # true
    ```
- `getColumnListing(bool $includePrimaryKeys = true, bool $includeTimestamps = false): array` : Retorna todas as colunas da table

    ```
    $schema->getColumnListing();
    /*
    [
      "id",
      "uuid",
      "pedido_status_id",
    ]
    */
    ```
- `hasColumn(string $column): bool`: Verifica se a coluna exists

    ```
    $schema->hasColumn('id');
    # true

    ```
- `hasColumns(array $columns): bool`:Verifica se as colunas exists

    ```
    $schema->hasColumns(['id', 'uuid']);
    # true
    ```
- `hasColumnsTimestamps(): bool`: Verifica se a coluna exists

    ```
    $schema->hasColumnsTimestamps();
    # true
    ```
- `getTypeFromColumns(array $columns): array`: Pega todos os tipos das colunas

    ```
    $schema->getTypeFromColumns(['id', 'uuid']);
    /*
    [
      "id" => "integer",
      "uuid" => "guid",
    ]
    */
    ```
- `getColumnType(string $column): string`:Retorna o type da colunas

    ```
    $schema->getColumnType('id');
    # "integer"
    ```
- `getDoctrineColumn(string $column): array`:Retorna todas as informações da colunas

    ```
    $schema->getDoctrineColumn('id');
    /*
    [
      "name" => "id",
      "type" => Doctrine\DBAL\Types\IntegerType {#4751},
      "default" => null,
      "notnull" => true,
      "length" => null,
      "precision" => 10,
      "scale" => 0,
      "fixed" => false,
      "unsigned" => false,
      "autoincrement" => true,
      "columnDefinition" => null,
      "comment" => null,
      "primary_key" => true,
    ]
    */
    ```
- `isPrimaryKey(string $column): bool`:Verifica se a coluna é pk

    ```
    $schema->isPrimaryKey('id');
    # true
    ```
- `primaryKeys(): array`:Retorna as chaves pks

    ```
    $schema->primaryKeys();
    /*
    [
      "id",
    ]
    */
    ```
- `hasModelWithTableName(string $table = null): bool|string`:Verifica se a table já existe model eloquent criada

    ```
    $schema->hasModelWithTableName();
    # "App\Models\Pedidos"

    $schema->hasModelWithTableName('abc');
    # false
    ```
- `getAllTables(): array`: Todas as tabelas da conexão

    ```
    $schema->getAllTables();
    /*
    [
      'pedidos',
      'pedido_status,
      ...
    ]
    */
    ```
- `hasForeinsKey(string $column, bool $fromStubReplace = false): bool|array`: Verifica se a coluna é uma foreing key e devolve os dados do relacionamento

    ```
     $schema->hasForeinsKey('pedido_status_id');
    /*
      [
      "table" => "pedido_status",
      "tableCamel" => Illuminate\Support\Stringable {#5069
      value: "pedidoStatus",
      },
      "related" => Illuminate\Support\Stringable {#5068
      value: "",
      },
      "relatedInstance" => false,
      "foreignKey" => "pedido_status_id",
      "ownerKey" => "id",
    ]
    */
    ```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~24 days

Total

3

Last Release

1110d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9857d9f527903d58285b8afd4c9cc5d4150041a5951ba5b84c399d0e579b0255?d=identicon)[gsferro](/maintainers/gsferro)

---

Top Contributors

[![gsferro](https://avatars.githubusercontent.com/u/12704346?v=4)](https://github.com/gsferro "gsferro (7 commits)")

---

Tags

laravelschemadatabasedoctrineeloquentbuildereasy

### Embed Badge

![Health badge](/badges/gsferro-database-schema-easy/health.svg)

```
[![Health](https://phpackages.com/badges/gsferro-database-schema-easy/health.svg)](https://phpackages.com/packages/gsferro-database-schema-easy)
```

###  Alternatives

[anourvalar/eloquent-serialize

Laravel Query Builder (Eloquent) serialization

11120.2M21](/packages/anourvalar-eloquent-serialize)[devio/eavquent

EAV modeling package for Eloquent and Laravel.

6410.4k](/packages/devio-eavquent)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
