PHPackages                             oncampus/model-repositories - 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. oncampus/model-repositories

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

oncampus/model-repositories
===========================

Connect file repositories to your eloquent models

09PHP

Since Aug 6Pushed 6y agoCompare

[ Source](https://github.com/oncampus/model-repositories)[ Packagist](https://packagist.org/packages/oncampus/model-repositories)[ RSS](/packages/oncampus-model-repositories/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

Description
===========

[](#description)

This package ensures that your models get their own storage directories.

Install
=======

[](#install)

Get the package
---------------

[](#get-the-package)

```
composer require oncampus/model-repositories

```

Extend the subjected model classes
----------------------------------

[](#extend-the-subjected-model-classes)

```
use Oncampus\ModelRepositories\Traits\PublicRepository; // for public repositories
use Oncampus\ModelRepositories\Traits\PrivateRepository; // for private repositories

```

All models can have both repository types!

Inside the model classes you have to use the traits.

```
use PublicRepository, PrivateRepository;

```

Migration
---------

[](#migration)

```
php artisan migrate

```

Usage
=====

[](#usage)

Functions
---------

[](#functions)

The private and public repository has almost all the storage functions that the Laravel Framework provides.

Example for the Laravel standard:

```
Storage::put($file, $content);

```

Example for this Model repositories package:

```
Auth::user()->privateRepository->put($file, $content);

```

Some functions must have different names due to the inheritance hierarchies. The following storage function calls have the following names via this repository package:

```
Storage::append()   -->     $repository->appendContent()
Storage::prepend()  -->     $repository->prependContent()
Storage::delete()   -->     $repository->remove()

```

Some functions (for example move() or rename()) are not implemented yet. Feel free to implement them and make a pull request.

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity36

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/2eb47b3cdf8e8ae1d3f0ee3a2a77fb0d87a01c932c359f794db4814d725c9ce6?d=identicon)[oncampus](/maintainers/oncampus)

---

Top Contributors

[![bedoke](https://avatars.githubusercontent.com/u/14050253?v=4)](https://github.com/bedoke "bedoke (10 commits)")

### Embed Badge

![Health badge](/badges/oncampus-model-repositories/health.svg)

```
[![Health](https://phpackages.com/badges/oncampus-model-repositories/health.svg)](https://phpackages.com/packages/oncampus-model-repositories)
```

###  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)
