PHPackages                             alex-oliveira/ao-logs - 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. [Logging &amp; Monitoring](/categories/logging)
4. /
5. alex-oliveira/ao-logs

ActivePackage[Logging &amp; Monitoring](/categories/logging)

alex-oliveira/ao-logs
=====================

Resources for Logs with Laravel.

027PHP

Since Feb 28Pushed 8y ago1 watchersCompare

[ Source](https://github.com/alex-oliveira/ao-logs)[ Packagist](https://packagist.org/packages/alex-oliveira/ao-logs)[ RSS](/packages/alex-oliveira-ao-logs/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependenciesVersions (1)Used By (0)

Ao-Logs
=======

[](#ao-logs)

### 1) Installing

[](#1-installing)

```
$ composer require alex-oliveira/ao-logs

```

### 2) Configuring "config/app.php" file

[](#2-configuring-configappphp-file)

```
'providers' => [
    /*
     * Vendor Service Providers...
     */
    AoLogs\ServiceProvider::class,
],

```

### 3) Create "config/ao.php" file

[](#3-create-configaophp-file)

```
return [
    .
    .
    .
    'models' => [
        'users' => App\Models\User::class,
    ],

    'tables' => [
        'users' => 'users'
    ]
    .
    .
    .
];

```

### 4) Publish migrations

[](#4-publish-migrations)

```
$ php artisan vendor:publish --tag=ao-logs

```

```
$ composer dump

```

Utilization
===========

[](#utilization)

Migration
---------

[](#migration)

### Up

[](#up)

```
public function up()
{
    AoLogs()->schema()->create('users');
}

```

the same that

```
public function up()
{
    Schema::create('ao_logs_x_users', function (Blueprint $table) {
        $table->integer('user_id')->unsigned();
        $table->foreign('user_id', 'fk_users_x_ao_logs')->references('id')->on('users');

        $table->bigInteger('log_id')->unsigned();
        $table->foreign('log_id', 'fk_ao_logs_x_users')->references('id')->on('ao_logs_logs');

        $table->primary(['user_id', 'log_id'], 'pk_ao_logs_x_users');
    });
}

```

### Down

[](#down)

```
public function down()
{
    AoLogs()->schema()->drop('users');
}

```

the same that

```
public function down()
{
    Schema::dropIfExists('ao_logs_x_users');
}

```

Model
-----

[](#model)

```
namespace App\Models;

use AoLogs\Traits\AoLogsTrait;
use Illuminate\Database\Eloquent\Model;

class User extends Model
{
    use AoLogsTrait;
}

```

the same that

```
namespace App\Models;

use AoLogs\Models\Log;
use Illuminate\Database\Eloquent\Model;

class User extends Model
{
    /**
     * @return Log[]|\Illuminate\Database\Eloquent\Relations\BelongsToMany
     */
    public function logs()
    {
        return $this->belongsToMany(Log::class, 'ao_logs_x_users');
    }
}

```

Controller
----------

[](#controller)

```
namespace App\Http\Controllers\Users;

use AoLogs\Controllers\AoLogsController;
use App\Models\User;

class LogsController extends AoLogsController
{
    protected $dynamicClass = User::class;
}

```

Routes
------

[](#routes)

```
Route::group(['prefix' => 'users', 'as' => 'users.'], function () {

    AoLogs()->router()->controller('Users\LogsController')->foreign('user_id')->make();
    .
    .
    .

});

```

### Checking routes

[](#checking-routes)

```
$ php artisan route:list

```

Registering log
---------------

[](#registering-log)

```
$category = \App\Models\Category::find(1);
.
.
.
AoLogs()->post($category, [
    'title' => 'Cadastro realizado.',
    'description' => 'O usuário "Alex Oliveira" realizou o cadastro da categoria "Computadores".'
]);

```

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/e826fd88857da403181f2a4e7f1834909414a5ded31cc5e9362c5677dae92877?d=identicon)[alex-oliveira](/maintainers/alex-oliveira)

---

Top Contributors

[![alex-oliveira](https://avatars.githubusercontent.com/u/5826507?v=4)](https://github.com/alex-oliveira "alex-oliveira (11 commits)")

### Embed Badge

![Health badge](/badges/alex-oliveira-ao-logs/health.svg)

```
[![Health](https://phpackages.com/badges/alex-oliveira-ao-logs/health.svg)](https://phpackages.com/packages/alex-oliveira-ao-logs)
```

###  Alternatives

[psr/log

Common interface for logging libraries

10.4k1.2B9.2k](/packages/psr-log)[itsgoingd/clockwork

php dev tools in your browser

5.9k27.6M94](/packages/itsgoingd-clockwork)[graylog2/gelf-php

A php implementation to send log-messages to a GELF compatible backend like Graylog2.

41838.2M138](/packages/graylog2-gelf-php)[bugsnag/bugsnag-psr-logger

Official Bugsnag PHP PSR Logger.

32132.5M2](/packages/bugsnag-bugsnag-psr-logger)[consolidation/log

Improved Psr-3 / Psr\\Log logger based on Symfony Console components.

15462.2M7](/packages/consolidation-log)[datadog/php-datadogstatsd

An extremely simple PHP datadogstatsd client

19124.6M15](/packages/datadog-php-datadogstatsd)

PHPackages © 2026

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