PHPackages                             invoiceninja/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. [Database &amp; ORM](/categories/database)
4. /
5. invoiceninja/inspector

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

invoiceninja/inspector
======================

Simplified database records management

v3.0(2y ago)9313.7k↓36%1[6 issues](https://github.com/invoiceninja/inspector/issues)MITPHPPHP ^8.2

Since Jun 22Pushed 2y ago4 watchersCompare

[ Source](https://github.com/invoiceninja/inspector)[ Packagist](https://packagist.org/packages/invoiceninja/inspector)[ Docs](https://github.com/invoiceninja/inspector)[ RSS](/packages/invoiceninja-inspector/feed)WikiDiscussions main Synced 1w ago

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

 [![inspector logo](https://raw.githubusercontent.com/invoiceninja/inspector/main/resources/static/cover.png)](https://raw.githubusercontent.com/invoiceninja/inspector/main/resources/static/cover.png)

Simplified database records management. Inspector will let you take care of [CRUD](https://en.wikipedia.org/wiki/Create,_read,_update_and_delete) without taking over your frontend.

Example
-------

[](#example)

```
$inspector = new \InvoiceNinja\Inspector\Inspector();

// List all tables in the database
$tables = $inspector->getTableNames();

// Get table columns
$columns = $inspector->getTableColumns('users');
```

- [Example](#example)
- [Installation](#installation)
- [Requirements](#requirements)
- [Philosophy](#philosophy)
- [Usage](#usage)
    - [Showing tables in the database](#showing-tables-in-the-database)
    - [Showing table columns](#showing-table-columns)
    - [Showing table records](#showing-table-records)
    - [Showing &amp; editing row in the table](#showing--editing-row-in-the-table)
    - [Updating table row](#updating-table-row)
- [Configuration](#configuration)
- [Available methods](#available-methods)
- [Contributing](#contributing)
    - [Security](#security)
- [Credits](#credits)
- [License](#license)

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

[](#installation)

You can install the package via composer:

```
composer require invoiceninja/inspector
```

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

[](#requirements)

- Laravel 8.x
- PHP 7.4+

Philosophy
----------

[](#philosophy)

Inspector isn't your regular admin panel. It is meant to be used as part of the admin panel. That said, we wanted something that is lightweight and it doesn't take over your front end.

It doesn't care about your CSS framework, do you use Livewire or not, because you're in charge of integrating it. Don't worry, it's extremely simple.

Usage
-----

[](#usage)

Like we previously said, **you're in charge** of integrating Inspector, but we will give you the most simple examples here.

Start by creating one controller, we will name it `TableController`.

```
php artisan make:controller TableController
```

### Showing tables in the database

[](#showing-tables-in-the-database)

```
public function index(\InvoiceNinja\Inspector\Inspector $inspector)
{
    return view('tables.index', [
        'tables' => $inspector->getTableNames(),
    ]);
}
```

Now, to show all these tables, you can make your own loop. To speed things up, we've provided some prebuilt components.

```

```

This will show a nice preview of all tables in your database.

TablesFailed jobsMigrationsPassword resetsPersonal access tokensUsersAwesome, let's make the link to the individual table page. We can do this by passing the `show-route-name` parameter in the component.

```

```

> Note: Route name is fully **optional**. We're using a resourceful controller, following Laravel conventions.

By doing that, we should get a new "View" action in our table:

TableActionFailed jobsViewMigrationsViewPassword resetsViewPersonal access tokensViewUsersView### Showing table columns

[](#showing-table-columns)

It might be useful for you to preview table columns &amp; their types. To achieve that we can use the `getTableColumns` method.

```
public function show(string $table, \InvoiceNinja\Inspector\Inspector $inspector)
{
    return view('tables.show', [
        'columns' => $inspector->getTableColumns($table),
    ]);
}
```

```

```

That will produce a nice table with all columns/types.

ColumnTypeidintegermigrationstringbatchinteger### Showing table records

[](#showing-table-records)

To show table records, we can make use of the `getTableRecords` method.

```
public function show(string $table, \InvoiceNinja\Inspector\Inspector $inspector)
{
    return view('tables.show', [
        'table' => $inspector->getTableSchema($table),
        'columns' => $inspector->getTableColumns($table),
        'records' => $inspector->getTableRecords($table),
    ]);
}
```

```

```

To generate a link to a specific record, pass `show-route-name`:

```

```

This will generate URL like this: `/tables/{table}/edit?id=1`.

\#idmigrationbatchView12014\_10\_12\_000000\_create\_users\_table1### Showing &amp; editing row in the table

[](#showing--editing-row-in-the-table)

Showing a page for the specific row is super simple. We can make use of the `getTableRecord` method.

```
public function edit(string $table, \Illuminate\Http\Request $request, \InvoiceNinja\Inspector\Inspector $inspector)
{
    return view('tables.edit', [
        'table' => $inspector->getTableSchema($table),
        'columns' => $inspector->getTableColumns($table),
        'record' => $inspector->getTableRecord($table, $request->query('id')),
    ]);
}
```

```

```

This will generate the form with all columns as input fields &amp; their values as part of input values.

> Note: `update-route-name` is **optional**.

### Updating table row

[](#updating-table-row)

One thing that is left is updating the table row. As you can probably guess, Inspector provides a helper method - `updateTableRecord`.

```
public function update(string $table, \Illuminate\Http\Request $request, \InvoiceNinja\Inspector\Inspector $inspector)
{
    $inspector->validate($request, $table);

    $success = $inspector->updateTableRecord($table, $request->query('id'), $request);

    if ($success) {
        return back()->withMessage('Successfully updated the record.');
    }

    return back()->withMessage('Oops, something went wrong.');
}
```

Configuration
-------------

[](#configuration)

We did our best to make Inspector as configurable as possible. To tinker with a configuration file, make sure to publish it first.

```
php artisan vendor:publish --provider="InvoiceNinja\Inspector\InspectorServiceProvider"
```

With configuration published, you can control visible tables, as well as hidden, component classes &amp; modify them as you wish.

Available methods
-----------------

[](#available-methods)

- `setConnectionName(string $connectionName): self` - Set the database connection. By default it will pick up your default app connection.
- `getConnectionName(): string` - Retrieve the current connection name.
- `getSchemaManager(): Doctrine\DBAL\Schema\AbstractSchemaManager` - Retrieve current schema manager instance.
- `getTableNames(): array` - Retrieve the list of table names in the database.
- `getTableSchema(string $table): Doctrine\DBAL\Schema\Table` - Retrieve `Table` representation of table.
- `getTableColumns(string $table): array` - Retrieve all columns for specified table.
- `getTable(string $table): Illuminate\Database\Query\Builder` - Table instance of query builder.
- `getTableRecords(string $table, array $columns = ['*']): Illuminate\Support\Collection` - Retrieve all records for the specified table.
- `getTableRecord(string $table, string $value, string $column = 'id'): mixed` - Retrieve single record for specified table.
- `updateTableRecord(string $table, string $id, Request $request, string $column = 'id'): bool` - Update specific table row.
- `validate(Request $request, string $table)` - Validate specific request.

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

[](#contributing)

Please see [CONTRIBUTING](https://github.com/invoiceninja/invoiceninja/blob/master/CONTRIBUTING.md) for details.

### Security

[](#security)

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

Credits
-------

[](#credits)

- [Benjamin Beganović](https://github.com/invoiceninja)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

34

—

LowBetter than 74% of packages

Maintenance7

Infrequent updates — may be unmaintained

Popularity38

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 97.5% 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 ~356 days

Total

3

Last Release

798d ago

Major Versions

v1.0 → v2.02023-08-20

v2.0 → v3.02024-06-04

PHP version history (3 changes)v1.0PHP ^7.4|^8.0

v2.0PHP ^7.4|^8.1

v3.0PHP ^8.2

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/5827962?v=4)[David Bomba](/maintainers/turbo124)[@turbo124](https://github.com/turbo124)

---

Top Contributors

[![beganovich](https://avatars.githubusercontent.com/u/13711415?v=4)](https://github.com/beganovich "beganovich (77 commits)")[![turbo124](https://avatars.githubusercontent.com/u/5827962?v=4)](https://github.com/turbo124 "turbo124 (2 commits)")

---

Tags

databaselaravelmanagementphpinspectorinvoiceninja

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

PHPackages © 2026

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