PHPackages                             margatampu/laravel-inspector - 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. margatampu/laravel-inspector

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

margatampu/laravel-inspector
============================

Watching and observing requests, logs, and listed models to maintain all possible acivities.

v1.2.9(7y ago)069MITPHPPHP ^7.0

Since Oct 30Pushed 6y ago1 watchersCompare

[ Source](https://github.com/margatampu/laravel-inspector)[ Packagist](https://packagist.org/packages/margatampu/laravel-inspector)[ RSS](/packages/margatampu-laravel-inspector/feed)WikiDiscussions master Synced yesterday

READMEChangelog (10)Dependencies (1)Versions (17)Used By (0)

laravel-inspector
=================

[](#laravel-inspector)

[![Latest Version on Packagist](https://camo.githubusercontent.com/4c4d22312397ddf3bd8265545c04fac5be27664ab314410f9c85cb8beec483a8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d6172676174616d70752f6c61726176656c2d696e73706563746f722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/margatampu/laravel-inspector)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Total Downloads](https://camo.githubusercontent.com/89f9854964f4fc67d0d3e3037b106fe83a5b2fcce54abeb339234d2ebcc1c400/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d6172676174616d70752f6c61726176656c2d696e73706563746f722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/margatampu/laravel-inspector)

Watching and observing requests, logs, and listed models to maintain all possible activities. Laravel inspector use to do it and storing data in separate database.

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

[](#installation)

Require this package with composer.

```
$ composer require margatampu/laravel-inspector
```

Integration
-----------

[](#integration)

Package tested and worked with Laravel and Lumen framework (5.7+).

**Laravel**: After installation using composer finishes up, you'll have to add the following line to your `config/app.php`:

```
MargaTampu\LaravelInspector\InspectorServiceProvider::class
```

**Lumen**: For Lumen, you'll have to add the following line to your `bootstrap/app.php`:

```
$app->register(MargaTampu\LaravelInspector\InspectorServiceProvider::class);
```

**Laravel**: Then copy `inspector` config file from laravel-inspector to your config folder:

```
$ php artisan vendor:publish --provider="MargaTampu\LaravelInspector\InspectorServiceProvider"
```

**Lumen**: For Lumen, you need to copy file manually to your config folder and enable it in `bootstrap/app.php`:

```
$app->configure('inspector');
```

After configuration, migrate all necessary database structure from laravel-inspector with (prerequisite setting database in `.env` file):

```
$ php artisan migrate
```

To make sure laravel-inspector running securily, you need to generate inspector auth token using console command line with default value:

```
$ php artisan inspector:auth
```

It will generate a random key, and you need to [store it in your .env](#setup-env-file) file.

Last step for your integration, you need to add this line to your `routes\api.php` file to use laravel-inspector api route to handle storing data to database.

```
MargaTampu\LaravelInspector\Inspector::api();
```

Configuring config file
-----------------------

[](#configuring-config-file)

For your models activity, you need to listing all your models you want to watched. Placed all your models in `config\inspector.php` file inside `models` element.

```
'models' => [
    'App\User'
],
```

Setup env file
--------------

[](#setup-env-file)

After installation and some integration, you need to update setup in your `.env` file. Besides database setting, you can add variable:

- `INSPECTOR_QUEUE_NAME`, separate or merge inspector queue with your laravel default queue.
- `INSPECTOR_LOG`, to limit log level watched.
- `INSPECTOR_MODEL_ENABLE`, set to true to enable watched listed models.
- `INSPECTOR_LOG_ENABLE`, set to true to enable watched all log generated.
- `INSPECTOR_REQUEST_ENABLE`, set to true to enable watched request called.
- `INSPECTOR_AUTHORIZATION`, to store your generated auth token.

Don't forgot to change your `APP_URL` as well with your current application domain url. It is use as api route url to store all your inspector data.

Go Ahaed
--------

[](#go-ahaed)

For expert use, you can ignore last step for integration steps for copying inspector API, and copied laravel-inspector api routes manually to your `routes/api.php` file and use your own controller to maintain data before store to database.

Then, you can store your destination url in `.env file` using this variables:

- `INSPECTOR_MODEL_ENDPOINT`, full url to handle model inspector.
- `INSPECTOR_LOG_ENDPOINT`, full url to handle log inspector.
- `INSPECTOR_REQUEST_ENDPOINT`, full url to handle request inspector.

Migration Customization
-----------------------

[](#migration-customization)

If you plan to separate service and consumer, you can ignore migrations of inspector package to prevent project migrate unnecessary tables to your consumer database. You should call the `Inspector::ignoreMigrations` method in the register method of your `AppServiceProvider`.

Queueing Jobs
-------------

[](#queueing-jobs)

To prevent inspector slowing your projects, you can queueing inspector jobs using separate queue name `inspector`. You can run single queue worker for it using this command:

```
$ php artisan queue:work --tries=1 --queue=inspector
```

Usage
-----

[](#usage)

To use this package, after all integration steps done. You will have your requests, logs and models activity in database.

Console Command
---------------

[](#console-command)

You did run inspector:auth command before to generate new inspector default auth token. Beside it, we have several commands available:

- Custom inspector auth name

You can custom your own inspector auth name using this command:

```
$ php artisan inspector:auth --new
```

- Update name of existing inspector auth

You allowed to rename your existing inpector auth name using: **Note: Replace {$id} with your inspector auth id**

```
$ php artisan inspector:auth --name={$id}
```

- Refresh token of existing inspector auth

Like inspector auth name, you also allowed to change token or refresh it using: **Note: Replace {$id} with your inspector auth id**

```
$ php artisan inspector:auth --refresh={$id}
```

Testing
-------

[](#testing)

For some laravel/lumen project, this package still not stable in some parts. If you want to test this package, you have several command to test it.

- Run all modules test with a single command

You can run a single command to run test all modules (model, log, and request).

```
$ php artisan inspector:test --all
```

- Run model module test only

Since you can enable and disable module in configuration file, you also enable to run single module too.

```
$ php artisan inspector:test --model
$ php artisan inspector:test --log
$ php artisan inspector:test --request
```

### Prerequisit for testing modules

[](#prerequisit-for-testing-modules)

To ensure your package test module run smoothly, you need to recheck some configurations:

1. Since the package test using running database (not separated test database), please change your current database to new fresh database or you will need to delete inserted data manually.
2. Queue connection using sync. Use connection besides it will force test to exit.
3. Check if module enable for model, log, and/or request. Disable module will not run test for it.
4. For model module test, package use User class model, so you need to ensure that User model and factory are available for use. But if you disable model module, you can skip this step.
5. For request module test, package use guzzle/http to acces your main page (url('/')), please ensure that url exist to access. But if you disable request module, you can skipt this step too.

License
-------

[](#license)

This laravel-teams-logging package is available under the MIT license. See the LICENSE file for more info.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

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

Every ~11 days

Recently: every ~18 days

Total

16

Last Release

2585d ago

Major Versions

v0.0.2 → v1.0.02018-11-01

### Community

Maintainers

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

---

Top Contributors

[![stampubolon](https://avatars.githubusercontent.com/u/37098202?v=4)](https://github.com/stampubolon "stampubolon (30 commits)")[![margatampu](https://avatars.githubusercontent.com/u/3712334?v=4)](https://github.com/margatampu "margatampu (5 commits)")

### Embed Badge

![Health badge](/badges/margatampu-laravel-inspector/health.svg)

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

###  Alternatives

[spatie/laravel-health

Monitor the health of a Laravel application

85810.0M83](/packages/spatie-laravel-health)[marvinlabs/laravel-discord-logger

Logging to a discord channel in Laravel

2081.1M2](/packages/marvinlabs-laravel-discord-logger)[larabug/larabug

Laravel 6.x/7.x/8.x/9.x/10.x/11.x/12.x/13.x bug notifier

299549.3k1](/packages/larabug-larabug)[honeybadger-io/honeybadger-php

Honeybadger PHP library

381.5M4](/packages/honeybadger-io-honeybadger-php)

PHPackages © 2026

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