PHPackages                             vollborn/local-db - 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. vollborn/local-db

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

vollborn/local-db
=================

v1.0.0(4y ago)316MITPHPPHP ^7.4|^8.0

Since Dec 30Pushed 3y ago1 watchersCompare

[ Source](https://github.com/vollborn/local-db)[ Packagist](https://packagist.org/packages/vollborn/local-db)[ RSS](/packages/vollborn-local-db/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

LocalDB
=======

[](#localdb)

LocalDB is a small package to read and write JSON files in a Laravel Eloquent like style.
It was originally developed for small web servers that cannot connect to classic databases.

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

[](#installation)

This package ist available via [composer](https://getcomposer.org/).

```
composer require vollborn/local-db
```

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

[](#configuration)

### Set the base path

[](#set-the-base-path)

In the base path all json files are stored. The default value is **../storage/local-db**.

You can change it if you need to:

```
LocalDB::setBasePath();
```

### Register a table

[](#register-a-table)

Every table or json file needs to be registered beforehand.

```
LocalDB::table('test', static function (Table $table) {
    $table->int('int')->autoincrements();
    $table->array('array')->nullable();
    $table->boolean('boolean');
    $table->float('float');
    $table->string('string');
});
```

As you can see, there are multiple data types available:

NameFunctionIntegerintArrayarrayBooleanbooleanFloatfloatStringstringIn addition, integers can have *autoincrements*.
All data types can also be *nullable*.

Usage
-----

[](#usage)

### Create data

[](#create-data)

```
LocalDB::query('test')->create([
    'float' => 1.00,
    'string' => null,
    'boolean' => false,
    'array' => []
]);
```

### Get data

[](#get-data)

You can either get all data...

```
LocalDB::query('test')->get();
```

or just the first entry...

```
LocalDB::query('test')->first();
```

The data can also be filtered.

```
LocalDB::query('test')->where('float', '=', 1.00)->get();
```

Available operators:

- =
- !=
- &lt;
- &gt;
- &lt;=
- &gt;=

Furthermore, the data can be ordered.

```
// ascending
LocalDB::query('test')->orderBy('float')->get();

// descending
LocalDB::query('test')->orderBy('float', true)->get();
```

There are some numeric operations available too.

```
// minimal value
LocalDB::query('test')->min('float');

// maximal value
LocalDB::query('test')->max('float');

// average value
LocalDB::query('test')->avg('float');

// summed value
LocalDB::query('test')->sum('float');
```

### Update data

[](#update-data)

```
LocalDB::query('test')
    ->where('boolean', '=', false)
    ->update([
        'boolean' => true
    ]);
```

### Delete data

[](#delete-data)

```
LocalDB::query('test')
    ->where('boolean', '=', false)
    ->delete();
```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity54

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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1592d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1c8b6150208053c88ce388497f683c52458b4e1b8f6d41daa53a68809ed94343?d=identicon)[vollborn](/maintainers/vollborn)

---

Top Contributors

[![vollborn](https://avatars.githubusercontent.com/u/67763683?v=4)](https://github.com/vollborn "vollborn (8 commits)")

---

Tags

composerdatabaseeloquentjsonlaravelpackagepackagistphpphp-json

### Embed Badge

![Health badge](/badges/vollborn-local-db/health.svg)

```
[![Health](https://phpackages.com/badges/vollborn-local-db/health.svg)](https://phpackages.com/packages/vollborn-local-db)
```

###  Alternatives

[doctrine/orm

Object-Relational-Mapper for PHP

10.2k285.3M6.2k](/packages/doctrine-orm)[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k115.1M102](/packages/jdorn-sql-formatter)[illuminate/database

The Illuminate Database package.

2.8k52.4M9.3k](/packages/illuminate-database)[mongodb/mongodb

MongoDB driver library

1.6k64.0M545](/packages/mongodb-mongodb)[ramsey/uuid-doctrine

Use ramsey/uuid as a Doctrine field type.

90340.3M211](/packages/ramsey-uuid-doctrine)[reliese/laravel

Reliese Components for Laravel Framework code generation.

1.7k3.4M16](/packages/reliese-laravel)

PHPackages © 2026

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