PHPackages                             marque/trove - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. marque/trove

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

marque/trove
============

Core models, services, and contracts for Marque tracker platform

v2.0.0(3mo ago)046MITPHPPHP ^8.2

Since Feb 11Pushed 3mo agoCompare

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

READMEChangelogDependencies (7)Versions (2)Used By (6)

Marque Trove
============

[](#marque-trove)

Core models, services, and contracts for the [Marque](https://github.com/letterofmarque/marque) tracker platform.

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

[](#installation)

```
composer require marque/trove
```

Publish the config and run migrations:

```
php artisan vendor:publish --tag=trove-config
php artisan migrate
```

What's Included
---------------

[](#whats-included)

- **Torrent model** - info\_hash, metadata, file storage, bencode parsing
- **TorrentService** - CRUD, .torrent file upload/parsing, search
- **Role system** - User, Uploader, Moderator, Admin hierarchy
- **Tracker stats** - Passkey generation, upload/download/seedtime tracking per user
- **Authorization** - Policies for create, update, delete operations

User Model Setup
----------------

[](#user-model-setup)

Add the Trove traits and interface to your User model:

```
use Marque\Trove\Concerns\HasRoles;
use Marque\Trove\Concerns\HasTrackerStats;
use Marque\Trove\Contracts\UserInterface;

class User extends Authenticatable implements UserInterface
{
    use HasRoles, HasTrackerStats;
}
```

`HasRoles` gives you role checks:

```
$user->isAdmin();
$user->isModerator();
$user->isUploader();
$user->hasRoleAtLeast(Role::Moderator);
```

`HasTrackerStats` gives you tracker integration:

```
$user->passkey;                    // Auto-generated 32-char key
$user->getRatio();                 // Upload/download ratio
$user->getRatioForHumans();        // "1.25" or "Inf"
$user->getUploadedForHumans();     // "4.2 GB"
$user->meetsRatioRequirement(0.5); // Boolean
```

Working with Torrents
---------------------

[](#working-with-torrents)

```
use Marque\Trove\Contracts\TorrentServiceInterface;

$service = app(TorrentServiceInterface::class);

// List with pagination and search
$torrents = $service->list(perPage: 25, search: 'ubuntu');

// Upload a .torrent file (extracts info_hash, size, file count automatically)
$torrent = $service->createFromUpload($file, $user, 'Ubuntu 24.04', 'Official ISO');

// Find by info hash
$torrent = $service->findByInfoHash('a1b2c3d4...');

// Update
$service->update($torrent, ['name' => 'New Name']);

// Delete (removes stored file too)
$service->delete($torrent);
```

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

[](#configuration)

Published to `config/trove.php`:

KeyDefaultDescription`user_model``App\Models\User`Your User model class`storage_disk``local`Filesystem disk for .torrent files`ratio_mode``full`Ratio enforcement: `full`, `off`, or `seedtime``min_ratio``0.5`Minimum required ratio (when mode is `full`)`min_seedtime``86400`Minimum seedtime in seconds (when mode is `seedtime`)Migrations
----------

[](#migrations)

Trove creates:

- `torrents` table (info\_hash, name, description, size, file\_count, torrent\_file, user\_id)
- Adds `role` column to users table
- Adds `passkey`, `uploaded`, `downloaded`, `seedtime` columns to users table

Publish migrations to customise them:

```
php artisan vendor:publish --tag=trove-migrations
```

Roles
-----

[](#roles)

Four roles with a strict hierarchy:

RoleRankCan UploadCan ModerateUser0NoNoUploader1YesNoModerator2YesYesAdmin3YesYesAuthorization
-------------

[](#authorization)

Trove registers a `TorrentPolicy`:

- **Create** - Uploader role or above
- **Update** - Torrent owner, or Moderator+
- **Delete** - Moderator or above

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

[](#requirements)

- PHP 8.2+
- Laravel 12+

License
-------

[](#license)

MIT

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance82

Actively maintained with recent releases

Popularity3

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity46

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

97d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/074f3e81cde0a435c57bded42781ae326daa5493d02de1b45e710b82856abd5a?d=identicon)[lomsoftware](/maintainers/lomsoftware)

---

Top Contributors

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

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/marque-trove/health.svg)

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

###  Alternatives

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M687](/packages/barryvdh-laravel-ide-helper)[psalm/plugin-laravel

Psalm plugin for Laravel

3274.9M308](/packages/psalm-plugin-laravel)[orchestra/canvas

Code Generators for Laravel Applications and Packages

20917.2M158](/packages/orchestra-canvas)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)[flarum/core

Delightfully simple forum software.

211.3M1.9k](/packages/flarum-core)[kirschbaum-development/commentions

A package to allow you to create comments, tag users and more

12369.2k](/packages/kirschbaum-development-commentions)

PHPackages © 2026

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