PHPackages                             lancodev/laravel-logging - 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. lancodev/laravel-logging

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

lancodev/laravel-logging
========================

This is my package laravel-logging

0.7(1y ago)01.2k[4 PRs](https://github.com/lancodev/laravel-logging/pulls)MITPHPPHP ^8.2CI passing

Since Feb 22Pushed 1mo agoCompare

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

READMEChangelog (7)Dependencies (13)Versions (12)Used By (0)

Laravel Logging
===============

[](#laravel-logging)

[![Latest Version on Packagist](https://camo.githubusercontent.com/12bbfd0b8994fa84240a76a854dcc60f2b530e3031992ff47618777b9716c8ed/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c616e636f6465762f6c61726176656c2d6c6f6767696e672e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/lancodev/laravel-logging)[![GitHub Tests Action Status](https://camo.githubusercontent.com/6b538647038656d14d700d3966c7bd96e85e53dce234cba94c5f96fdc978b34e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6c616e636f6465762f6c61726176656c2d6c6f6767696e672f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/lancodev/laravel-logging/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/1c701e2db0f7b4ac6644909003cc37980da339f390711e64ee6c6872c9622baa/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6c616e636f6465762f6c61726176656c2d6c6f6767696e672f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/lancodev/laravel-logging/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/8531675a1c428a6bf9c6f8d2b2607cb0e1c79efcde6bf3f69ea4f08ef0b25998/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6c616e636f6465762f6c61726176656c2d6c6f6767696e672e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/lancodev/laravel-logging)

This package provides a simple way to log events to a database table. It provides a convenient `Loggable` Trait to allow you to link your logs to a model. It also provides a `Log` model that you can use to query your logs.

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

[](#installation)

You can install the package via composer:

```
composer require lancodev/laravel-logging
```

You can publish and run the migrations with:

```
php artisan vendor:publish --tag="laravel-logging-migrations"
php artisan migrate
```

Usage
-----

[](#usage)

Add the `Loggable` Trait to your model(s) that you want to log events for.

Then, you can create logs for the model using the `logs` relationship:

```
$model->logs()->create([
    'type' => 'Info',
    'log' => 'lorem ipsum',
]);
```

To view logs for a given model, you can use the `logs` relationship:

```
$model->logs;
```

Or use standard Eloquent query language to filter the logs by type, etc:

```
$model->logs()->where('type', 'Info')->get();

Lancodev\LaravelLogging\Models\Log {
  id: 1,
  loggable_type: "App\Models\{SOME_MODEL}",
  loggable_id: 1,
  type: "Info",
  log: "lorem ipsum",
  created_at: "2023-01-01 00:00:00",
  updated_at: "2023-01-01 00:00:00",
},
```

The `Log` model also has a `loggable` relationship that allows you to access the model that the log belongs to:

```
$log->loggable;****
```

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

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

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

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

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

[](#security-vulnerabilities)

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

Credits
-------

[](#credits)

- [Kyle Anderson](https://github.com/lancodev)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

39

—

LowBetter than 85% of packages

Maintenance70

Regular maintenance activity

Popularity14

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~86 days

Recently: every ~129 days

Total

7

Last Release

654d ago

PHP version history (2 changes)0.1PHP ^8.1

0.6PHP ^8.2

### Community

Maintainers

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

---

Top Contributors

[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (16 commits)")[![kylekanderson](https://avatars.githubusercontent.com/u/24831484?v=4)](https://github.com/kylekanderson "kylekanderson (14 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (12 commits)")

---

Tags

laravellaravel-logginglancodev

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/lancodev-laravel-logging/health.svg)

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

###  Alternatives

[spatie/laravel-health

Monitor the health of a Laravel application

85810.0M83](/packages/spatie-laravel-health)[spatie/laravel-slack-alerts

Send a message to Slack

3212.6M4](/packages/spatie-laravel-slack-alerts)[keepsuit/laravel-opentelemetry

OpenTelemetry integration for laravel

142347.8k](/packages/keepsuit-laravel-opentelemetry)[spatie/laravel-error-share

Share your Laravel errors to Flare

43965.6k3](/packages/spatie-laravel-error-share)[vormkracht10/laravel-mails

Laravel Mails can collect everything you might want to track about the mails that has been sent by your Laravel app.

24149.7k](/packages/vormkracht10-laravel-mails)[tapp/filament-maillog

Filament plugin to view outgoing mail

2952.6k1](/packages/tapp-filament-maillog)

PHPackages © 2026

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