PHPackages                             jalallinux/laravel-postgres-audit - 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. jalallinux/laravel-postgres-audit

ActiveLibrary

jalallinux/laravel-postgres-audit
=================================

Logging queries executed on Postgres even directly!!!

1.0.0(3y ago)026[2 PRs](https://github.com/jalallinux/laravel-postgres-audit/pulls)MITPHPPHP ^8.0|^8.1|^8.2

Since Nov 24Pushed 2y ago1 watchersCompare

[ Source](https://github.com/jalallinux/laravel-postgres-audit)[ Packagist](https://packagist.org/packages/jalallinux/laravel-postgres-audit)[ Docs](https://github.com/jalallinux/laravel-postgres-audit)[ Fund](https://reymit.ir/jalallinux)[ GitHub Sponsors](https://github.com/jalallinux)[ RSS](/packages/jalallinux-laravel-postgres-audit/feed)WikiDiscussions main Synced 1mo ago

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

[![Latest Version on Packagist](https://camo.githubusercontent.com/cff784d5bd5778af673fd64e90918b3f3d4da14e267aeb5b4213de55845691a4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6a616c616c6c696e75782f6c61726176656c2d706f7374677265732d61756469742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/jalallinux/laravel-postgres-audit)[![Tests](https://github.com/jalallinux/laravel-postgres-audit/actions/workflows/run-tests.yml/badge.svg?branch=main)](https://github.com/jalallinux/laravel-postgres-audit/actions/workflows/run-tests.yml)[![Total Downloads](https://camo.githubusercontent.com/8638e0573c52c27131024510e2ecfd3ab863247826d4a0e20c6fae9787306867/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6a616c616c6c696e75782f6c61726176656c2d706f7374677265732d61756469742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/jalallinux/laravel-postgres-audit)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

[](#)

Logging queries executed on Postgres even directly!!!

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

[](#installation)

You can install the package via composer:

```
composer require jalallinux/laravel-postgres-audit
```

You can publish the config file with:

```
php artisan vendor:publish --provider="JalalLinuX\PostgreAudit\PGAuditServiceProviders"
```

This is the contents of the published config file:

```
return [
/**
     * Target database connection
     */
    'connection' => 'pgsql',

    /**
     * Audit log table name
     */
    'table_name' => 'audit_logs',

    /**
     * Target tables for log
     * Set ['*'] to log for all tables
     * Split tables with comma
     */
    'target_tables' => '*',

    /**
     * Except tables for log
     * Except tables has more priority than target tables
     * Split tables with comma
     */
    'except_tables' => 'migrations, password_resets, personal_access_tokens, jobs, failed_jobs, notifications',

    /**
     * Ignore database user activity
     * Example: postgres, forge
     * NULL for logging all users
     * Split tables with comma
     */
    'except_users' => null,

    /**
     * Primary columns
     * Example: id, uuid, slug
     */
    'primary_columns' => 'uuid',

    /**
     * Primary columns type
     * Example: bigint, uuid, varchar
     */
    'primary_columns_type' => 'uuid',

    /**
     * Operations to log
     * Only support INSERT, DELETE, UPDATE
     */
    'operations' => 'INSERT, DELETE, UPDATE'
];
```

Usage
-----

[](#usage)

### Setup:

[](#setup)

```
php artisan pg-audit:setup
```

### Model:

[](#model)

Work with `PGAudit` model.

```
\JalalLinuX\PostgreAudit\PGAudit::where('table_name', 'users')->get()
```

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [JalalLinuX](https://github.com/jalallinux)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 76.9% 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

1265d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ddef4e15a6bda9c060f6e33ccfd0a268895bfb664936f9191a836de4d528d684?d=identicon)[jalallinux](/maintainers/jalallinux)

---

Top Contributors

[![jalallinux](https://avatars.githubusercontent.com/u/37062636?v=4)](https://github.com/jalallinux "jalallinux (30 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (5 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (4 commits)")

---

Tags

jalallinuxlaravel-postgres-audit

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/jalallinux-laravel-postgres-audit/health.svg)

```
[![Health](https://phpackages.com/badges/jalallinux-laravel-postgres-audit/health.svg)](https://phpackages.com/packages/jalallinux-laravel-postgres-audit)
```

###  Alternatives

[anourvalar/eloquent-serialize

Laravel Query Builder (Eloquent) serialization

11320.2M21](/packages/anourvalar-eloquent-serialize)[namu/wirechat

A Laravel Livewire messaging app for teams with private chats and group conversations.

54324.5k](/packages/namu-wirechat)[statamic-rad-pack/runway

Eloquently manage your database models in Statamic.

135192.6k5](/packages/statamic-rad-pack-runway)

PHPackages © 2026

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