PHPackages                             vluzrmos/eloquent-prefixes - 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. vluzrmos/eloquent-prefixes

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

vluzrmos/eloquent-prefixes
==========================

Allow to work with prefixes attributes name

v0.0.1(10y ago)141[1 issues](https://github.com/vluzrmos/eloquent-prefixes/issues)MITPHP

Since Feb 6Pushed 10y ago1 watchersCompare

[ Source](https://github.com/vluzrmos/eloquent-prefixes)[ Packagist](https://packagist.org/packages/vluzrmos/eloquent-prefixes)[ RSS](/packages/vluzrmos-eloquent-prefixes/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

Eloquent Prefixes
=================

[](#eloquent-prefixes)

That package allows you to prefix attributes on your eloquent models.

Installation
============

[](#installation)

```
composer require vluzrmos/eloquent-prefixes

```

Usage
=====

[](#usage)

You could use the model:

```
use Vluzrmos\Database\Eloquent\ModelWithPrefixedAttributes as Model;

class MyModel extends Model {

    /**
     * A string that should be used to prefix attributes.
     */
    protected $attributesPrefix = "my_";

    /**
     * Array of attributes to prefix
     */
    protected $attributesToPrefix = [
        'name',
        'email'
    ];

    protected $fillable = [
        'name',
        'email',
        // 'my_name', //only if you need it
        // 'my_email' //only if you need it
    ];
}
```

And then you can use:

```

$model = MyModel::first();

$model->name; //same of $model->my_name;
$model->name = "Vluzrmos"; //same of $model->my_name = "Vluzrmos";

MyModel::create([
   'name' => 'Vagner do Carmo',
   'email' => 'my_email@gmail.com'
]);

// its the same of

MyModel::create([
   'my_name' => 'Vagner do Carmo',
   'my_email' => 'my_email@gmail.com'
]);

//Note:: that should be on your fillable array.

```

You could use the Trait too, that works the same way:

```
ues Illuminate\Database\Eloquent\Model;
use Vluzrmos\Database\Eloquent\PrefixesAttributes;

class MyModel extends Model {

    use PrefixesAttributes;

    /**
     * A string that should be used to prefix attributes.
     */
    protected $attributesPrefix = "my_";

    /**
     * Array of attributes to prefix
     */
    protected $attributesToPrefix = [
        'name',
        'email'
    ];

    protected $fillable = [
        'name',
        'email',
        // 'my_name', //only if you need it
        // 'my_email' //only if you need it
    ];
}
```

TODO
====

[](#todo)

- Works with Query Builders
- Works with Model Attributes (Automatic Accessors and Mutators)

###  Health Score

20

—

LowBetter than 13% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity53

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

3797d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/450848?v=4)[Vagner Luz do Carmo](/maintainers/vluzrmos)[@vluzrmos](https://github.com/vluzrmos)

---

Top Contributors

[![vluzrmos](https://avatars.githubusercontent.com/u/450848?v=4)](https://github.com/vluzrmos "vluzrmos (7 commits)")

### Embed Badge

![Health badge](/badges/vluzrmos-eloquent-prefixes/health.svg)

```
[![Health](https://phpackages.com/badges/vluzrmos-eloquent-prefixes/health.svg)](https://phpackages.com/packages/vluzrmos-eloquent-prefixes)
```

###  Alternatives

[spatie/laravel-medialibrary

Associate files with Eloquent models

6.1k43.2M611](/packages/spatie-laravel-medialibrary)[mongodb/laravel-mongodb

A MongoDB based Eloquent model and Query builder for Laravel

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

The Laravel magic applied to joins.

1.6k32.6M42](/packages/kirschbaum-development-eloquent-power-joins)[yajra/laravel-oci8

Oracle DB driver for Laravel via OCI8

8793.2M23](/packages/yajra-laravel-oci8)[awobaz/compoships

Laravel relationships with support for composite/multiple keys

1.2k11.7M46](/packages/awobaz-compoships)[bavix/laravel-wallet

It's easy to work with a virtual wallet.

1.3k1.3M19](/packages/bavix-laravel-wallet)

PHPackages © 2026

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