PHPackages                             vicenterusso/laravel-table-structure - 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. vicenterusso/laravel-table-structure

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

vicenterusso/laravel-table-structure
====================================

This is my package TableStructure

v0.0.1(5y ago)0911MITPHPPHP ^7.2|^8.0

Since Apr 20Pushed 5y ago1 watchersCompare

[ Source](https://github.com/vicenterusso/laravel-table-structure)[ Packagist](https://packagist.org/packages/vicenterusso/laravel-table-structure)[ Docs](https://github.com/vicenterusso/laravel-table-structure)[ RSS](/packages/vicenterusso-laravel-table-structure/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (8)Versions (2)Used By (0)

Laravel Table Structure
=======================

[](#laravel-table-structure)

[![Latest Version on Packagist](https://camo.githubusercontent.com/616de56aa6eecc430fc5e75a07de877f25d498bc9dbb6082e900457ee20dc215/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f766963656e7465727573736f2f6c61726176656c2d7461626c652d7374727563747572652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/vicenterusso/laravel-table-structure)[![GitHub Tests Action Status](https://camo.githubusercontent.com/52a7cc57578b168f67664ce286169fce542f18c72bcb28d4075bf643e3febd42/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f766963656e7465727573736f2f6c61726176656c2d7461626c652d7374727563747572652f72756e2d74657374733f6c6162656c3d7465737473)](https://github.com/vicenterusso/laravel-table-structure/actions?query=workflow%3Arun-tests+branch%3Amaster)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/e4b8b6102c24354db211a229e19a795dc8c827b02f583cb3b92f6d570abfed62/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f766963656e7465727573736f2f6c61726176656c2d7461626c652d7374727563747572652f436865636b253230262532306669782532307374796c696e673f6c6162656c3d636f64652532307374796c65)](https://github.com/vicenterusso/laravel-table-structure/actions?query=workflow%3A%22Check+%26+fix+styling%22+branch%3Amaster)

This package helps you to get information about your table fields adding only a `trait` to your model. You can also optionally cache the results.

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require vicenterusso/laravel_table_structure
```

You can publish the config file with:

```
php artisan vendor:publish --provider="VRusso\TableStructure\TableStructureServiceProvider" --tag="laravel_table_structure-config"
```

This is the contents of the published config file:

```
return [

    /*
    |--------------------------------------------------------------------------
    | Enable Cache
    |--------------------------------------------------------------------------
    |
    | Enable or disable usage of cache for Schema queries.
    |
    */
    'use_cache' => false,

    /*
    |--------------------------------------------------------------------------
    | Cache Prefix
    |--------------------------------------------------------------------------
    |
    | Custom prefix for cache keys. Avoid empty values
    |
    */
    'cache_prefix' => env('TABLE_STRUCT_PREFIX', 'TABLE_STRUCT'),

];
```

Usage
-----

[](#usage)

Insert the following trait to any model, and you can retrieve all info about the table fields

```
# Add trait to model
use \VRusso\TableStructure\Traits\FieldsInfo;

# Call it anywhere
User::hasField('username');
//true/false

User::getAllFields();
//['username', 'password', ...]

User::getAllFieldsWithTypes();
//[
//    [
//    'field' => 'username',
//    'type' => 'string'
//    ],
//    (...)
//]

User::getAllFieldsWithTypeOf('integer');
//['id', ...]
```

Credits
-------

[](#credits)

- [Vicente Russo](https://github.com/vicenterusso)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity47

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

Unknown

Total

1

Last Release

1845d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/98f6d6b77f7eb23adffc0109e5211ad1cf28c5215ccd8f783a59ceb4ebd84470?d=identicon)[vicenterusso](/maintainers/vicenterusso)

---

Top Contributors

[![vicenterusso](https://avatars.githubusercontent.com/u/80538?v=4)](https://github.com/vicenterusso "vicenterusso (14 commits)")

---

Tags

databaselaravelschematablelaravelschemadatabasestructuretablevicenterussolaravel-table-structure

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Type Coverage Yes

### Embed Badge

![Health badge](/badges/vicenterusso-laravel-table-structure/health.svg)

```
[![Health](https://phpackages.com/badges/vicenterusso-laravel-table-structure/health.svg)](https://phpackages.com/packages/vicenterusso-laravel-table-structure)
```

###  Alternatives

[illuminate/database

The Illuminate Database package.

2.8k52.4M9.3k](/packages/illuminate-database)[clickbar/laravel-magellan

This package provides functionality for working with the postgis extension in Laravel.

423715.4k1](/packages/clickbar-laravel-magellan)[lacodix/laravel-model-filter

A Laravel package to filter, search and sort models with ease while fetching from database.

17649.9k](/packages/lacodix-laravel-model-filter)[thedevsaddam/laravel-schema

Display the connected database information in console.

11627.9k1](/packages/thedevsaddam-laravel-schema)[orptech/laravel-migration-partition

Laravel extensions that extends Illuminate to enable partitioned table creation within Laravel migrations.

3426.7k](/packages/orptech-laravel-migration-partition)

PHPackages © 2026

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