PHPackages                             golded-dev/laravel-ftn-database - 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. golded-dev/laravel-ftn-database

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

golded-dev/laravel-ftn-database
===============================

Laravel schema and base models for imported FTN archive facts.

1.1.0(1mo ago)015[2 PRs](https://github.com/golded-dev/laravel-ftn-database/pulls)MITPHPPHP ^8.4CI failing

Since Apr 29Pushed 1w agoCompare

[ Source](https://github.com/golded-dev/laravel-ftn-database)[ Packagist](https://packagist.org/packages/golded-dev/laravel-ftn-database)[ Docs](https://github.com/golded-dev/laravel-ftn-database)[ RSS](/packages/golded-dev-laravel-ftn-database/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (2)Dependencies (9)Versions (5)Used By (0)

Laravel FTN Database
====================

[](#laravel-ftn-database)

Laravel schema and base Eloquent models for imported FTN archive facts.

This package owns the durable facts that come from FTN message archives: areas, messages, source identity, addressing, bodies, reply metadata, control lines, and import provenance.

It does not own reader UI state. Read flags, bookmarks, cached counters, and current positions belong in the consuming app.

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

[](#installation)

```
composer require golded-dev/laravel-ftn-database:^1.0
```

Requires PHP 8.4+ and Laravel 13 components.

Supported database targets:

- SQLite
- MySQL
- PostgreSQL

What It Provides
----------------

[](#what-it-provides)

- `Golded\Ftn\Database\FtnDatabaseServiceProvider`
- `Golded\Ftn\Database\Models\Area`
- `Golded\Ftn\Database\Models\Message`
- config publishing through the `ftn-database-config` tag
- migration publishing through the `ftn-database-migrations` tag
- package migrations that load by default

Migrations
----------

[](#migrations)

The package creates `areas` and `messages`.

Package migrations load automatically unless the consumer disables them:

```
'load_migrations' => false,
```

Publish migrations when the app needs to own the files directly:

```
php artisan vendor:publish --tag=ftn-database-migrations
```

`control_lines_json` and `provenance_json` are text-backed JSON payloads with array casts on the model. That keeps SQLite, MySQL, and PostgreSQL behavior plain.

Config
------

[](#config)

Publish the config:

```
php artisan vendor:publish --tag=ftn-database-config
```

Default config:

```
return [
    'load_migrations' => true,

    'models' => [
        'area' => Golded\Ftn\Database\Models\Area::class,
        'message' => Golded\Ftn\Database\Models\Message::class,
    ],
];
```

Apps can point relationships at subclasses:

```
'models' => [
    'area' => App\Models\Area::class,
    'message' => App\Models\Message::class,
],
```

The base relationships resolve through config. They do not know about `App\Models`.

Models
------

[](#models)

Use the base models directly for archive-only apps:

```
use Golded\Ftn\Database\Models\Area;
use Golded\Ftn\Database\Models\Message;

$area = Area::create([
    'code' => 'TEST',
    'name' => 'Test Area',
    'source_type' => 'jam',
]);

Message::create([
    'area_id' => $area->id,
    'source_type' => 'jam',
    'source_uid' => 'jam:offset:256',
    'body_text' => 'Hello',
]);
```

For GoldED-style apps, subclass the models and add only app-owned state:

```
namespace App\Models;

use Golded\Ftn\Database\Models\Message as BaseMessage;

class Message extends BaseMessage
{
    protected $fillable = [
        'area_id',
        'msgno',
        'source_type',
        'source_uid',
        'body_text',
        'is_read',
        'is_marked',
        'is_bookmarked',
        'thread_key',
    ];
}
```

Keep imported archive facts in the package columns. Keep reader behavior in the app.

Identity
--------

[](#identity)

The import identity is:

- `area_id`
- `source_type`
- `source_uid`

`msgno` is display and navigation metadata. It is not identity.

`external_id` is unique only inside an area. Multiple `null` external IDs are allowed.

Development
-----------

[](#development)

Install dependencies:

```
composer install
```

Run tests:

```
composer test
```

Run static analysis:

```
composer test:types
```

Run Rector dry-run:

```
composer test:refactor
```

Run everything:

```
composer test:all
```

The MySQL migration check is skipped unless these environment variables are set:

- `FTN_DATABASE_MYSQL_DATABASE`
- `FTN_DATABASE_MYSQL_HOST`
- `FTN_DATABASE_MYSQL_PORT`
- `FTN_DATABASE_MYSQL_USERNAME`
- `FTN_DATABASE_MYSQL_PASSWORD`

The PostgreSQL migration check is skipped unless these environment variables are set:

- `FTN_DATABASE_POSTGRES_DATABASE`
- `FTN_DATABASE_POSTGRES_HOST`
- `FTN_DATABASE_POSTGRES_PORT`
- `FTN_DATABASE_POSTGRES_USERNAME`
- `FTN_DATABASE_POSTGRES_PASSWORD`

Versioning
----------

[](#versioning)

This package starts at `1.0.0` and uses semantic versioning.

Breaking changes include schema changes, model fillable or cast changes that affect persisted data, service provider behavior changes, and supported Laravel or PHP version changes.

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

[](#contributing)

Contributions are welcome when they keep the archive/app boundary sharp. See [CONTRIBUTING.md](CONTRIBUTING.md).

Security
--------

[](#security)

Do not report security issues in public tickets. See [SECURITY.md](SECURITY.md).

Changelog
---------

[](#changelog)

See [CHANGELOG.md](CHANGELOG.md).

License
-------

[](#license)

Released under the MIT License. See [LICENSE](LICENSE).

###  Health Score

43

—

FairBetter than 89% of packages

Maintenance95

Actively maintained with recent releases

Popularity8

Limited adoption so far

Community6

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

Every ~0 days

Total

2

Last Release

41d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/10bbe1cbea253f250b899d5704fbe59fc91ee40b14c017527409482187f365a1?d=identicon)[odinns](/maintainers/odinns)

---

Top Contributors

[![odinns](https://avatars.githubusercontent.com/u/10807424?v=4)](https://github.com/odinns "odinns (3 commits)")

---

Tags

laraveldatabasefidonetftngoldedmessage-base

###  Code Quality

TestsPest

Static AnalysisPHPStan, Rector

Type Coverage Yes

### Embed Badge

![Health badge](/badges/golded-dev-laravel-ftn-database/health.svg)

```
[![Health](https://phpackages.com/badges/golded-dev-laravel-ftn-database/health.svg)](https://phpackages.com/packages/golded-dev-laravel-ftn-database)
```

###  Alternatives

[mongodb/laravel-mongodb

A MongoDB based Eloquent model and Query builder for Laravel

7.1k8.0M84](/packages/mongodb-laravel-mongodb)[kirschbaum-development/eloquent-power-joins

The Laravel magic applied to joins.

1.6k29.9M42](/packages/kirschbaum-development-eloquent-power-joins)[psalm/plugin-laravel

Psalm plugin for Laravel

3325.1M337](/packages/psalm-plugin-laravel)[yajra/laravel-oci8

Oracle DB driver for Laravel via OCI8

8733.1M23](/packages/yajra-laravel-oci8)[spiritix/lada-cache

A Redis based, automated and scalable database caching layer for Laravel

592452.8k2](/packages/spiritix-lada-cache)[glushkovds/phpclickhouse-laravel

Adapter of the most popular library https://github.com/smi2/phpClickHouse to Laravel

2051.4M2](/packages/glushkovds-phpclickhouse-laravel)

PHPackages © 2026

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