PHPackages                             trogers1884/laravel-dbdepends - 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. trogers1884/laravel-dbdepends

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

trogers1884/laravel-dbdepends
=============================

A Laravel package that creates a view for PostgreSQL database dependencies

v1.0.0(1y ago)03MITPHPPHP ^8.1|^8.2|^8.3

Since Dec 15Pushed 1y ago1 watchersCompare

[ Source](https://github.com/trogers1884/laravel-dbdepends)[ Packagist](https://packagist.org/packages/trogers1884/laravel-dbdepends)[ RSS](/packages/trogers1884-laravel-dbdepends/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (4)Versions (2)Used By (0)

Laravel DB Depends
==================

[](#laravel-db-depends)

A Laravel package that creates a view for PostgreSQL database dependencies. This package helps you visualize and understand the relationships between tables, views, and materialized views in your PostgreSQL database by creating a comprehensive dependency map view.

Overview
--------

[](#overview)

The package creates a view named `tr1884_dbdepends_vw_dependency_map` that shows:

- Direct and indirect dependencies between database objects
- Object ownership information
- Dependency counts and details
- Requirements for each database object

Requirements
------------

[](#requirements)

- PHP 8.1 or higher
- Laravel 10.x or 11.x
- PostgreSQL database

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

[](#installation)

1. Install the package via composer:

```
composer require trogers1884/laravel-dbdepends
```

2. The package will automatically register its service provider.
3. Run the migrations to create the dependency map view:

```
php artisan migrate
```

Usage
-----

[](#usage)

Once installed, you can query the dependency map view like any other database view:

```
use Illuminate\Support\Facades\DB;

// Get all view dependencies
$views = DB::table('tr1884_dbdepends_vw_dependency_map')
    ->where('object_type', 'VIEW')
    ->get();

// Find objects with the most dependencies
$mostDependencies = DB::table('tr1884_dbdepends_vw_dependency_map')
    ->orderByDesc('deps')
    ->limit(10)
    ->get();
```

### View Columns

[](#view-columns)

The dependency map view includes the following columns:

ColumnTypeDescriptionrelationtextFully qualified name (schema.object\_name)object\_typetextTABLE, VIEW, or MATV (materialized view)ownernameObject owner's usernamedepsbigintNumber of direct dependenciesadd\_depsintegerNumber of indirect dependenciesreqsbigintNumber of direct requirementsadd\_reqsintegerNumber of indirect requirementsdependentstextList of direct dependent objectsadd\_dependentstextList of indirect dependent objectsrequirementstextList of direct required objectsadd\_requirementstextList of indirect required objectsTesting
-------

[](#testing)

To run the tests locally:

1. Copy the example PHPUnit configuration:

```
cp phpunit.xml.example phpunit.xml
```

2. Update `phpunit.xml` with your local PostgreSQL database credentials:

```

```

3. Run the tests:

```
./vendor/bin/phpunit
```

Note: `phpunit.xml` is git-ignored to prevent committing local database credentials.

Complete Uninstallation
-----------------------

[](#complete-uninstallation)

To completely remove the package from your Laravel application:

1. Drop the dependency map view from your database:

```
DROP VIEW IF EXISTS public.tr1884_dbdepends_vw_dependency_map;
```

2. Remove the migration record from your migrations table:

```
DELETE FROM migrations
WHERE migration = '2024_01_01_000001_create_tr1884_dbdepends_vw_dependency_map_view';
```

3. Remove the package from your composer.json:

```
composer remove trogers1884/laravel-dbdepends
```

4. Remove any cached configuration:

```
php artisan config:clear
composer dump-autoload
```

Contributing
------------

[](#contributing)

Contributions are welcome! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for details.

### Development Setup

[](#development-setup)

1. Fork the repository
2. Clone your fork
3. Install dependencies:

```
composer install
```

4. Copy the test configuration files:

```
cp phpunit.xml.example phpunit.xml
cp .env.example .env.testing
```

5. Update both files with your PostgreSQL test database credentials
6. Run the tests to ensure everything is set up correctly:

```
./vendor/bin/phpunit
```

Security
--------

[](#security)

If you discover any security-related issues, please email \[security contact\] instead of using the issue tracker.

Credits
-------

[](#credits)

- [Tom Rogers](https://github.com/trogers1884)
- [Jeremy Gleed](https://github.com/GITHUB_USERNAME)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance40

Moderate activity, may be stable

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity53

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

514d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/33fdd133f51e6eff6096d0dd0b15dd11184caa054ed0d7e1c70a1e8d5080a5c7?d=identicon)[trogers1884](/maintainers/trogers1884)

---

Top Contributors

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

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/trogers1884-laravel-dbdepends/health.svg)

```
[![Health](https://phpackages.com/badges/trogers1884-laravel-dbdepends/health.svg)](https://phpackages.com/packages/trogers1884-laravel-dbdepends)
```

###  Alternatives

[cybercog/laravel-love

Make Laravel Eloquent models reactable with any type of emotions in a minutes!

1.2k302.7k1](/packages/cybercog-laravel-love)[cviebrock/eloquent-taggable

Easy ability to tag your Eloquent models in Laravel.

567694.8k3](/packages/cviebrock-eloquent-taggable)[clickbar/laravel-magellan

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

423715.4k1](/packages/clickbar-laravel-magellan)[genealabs/laravel-pivot-events

This package introduces new eloquent events for sync(), attach(), detach() or updateExistingPivot() methods on BelongsToMany relation.

1404.9M8](/packages/genealabs-laravel-pivot-events)[reedware/laravel-relation-joins

Adds the ability to join on a relationship by name.

2121.2M13](/packages/reedware-laravel-relation-joins)[aglipanci/laravel-eloquent-case

Adds CASE statement support to Laravel Query Builder.

115157.2k](/packages/aglipanci-laravel-eloquent-case)

PHPackages © 2026

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