PHPackages                             stancl/virtualcolumn - 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. stancl/virtualcolumn

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

stancl/virtualcolumn
====================

Eloquent virtual column.

v1.5.0(1y ago)858.4M↓10.7%14[1 PRs](https://github.com/archtechx/virtualcolumn/pulls)11MITPHPCI passing

Since Jul 6Pushed 3mo ago4 watchersCompare

[ Source](https://github.com/archtechx/virtualcolumn)[ Packagist](https://packagist.org/packages/stancl/virtualcolumn)[ RSS](/packages/stancl-virtualcolumn/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (8)Dependencies (3)Versions (14)Used By (11)

Eloquent Virtual Column
=======================

[](#eloquent-virtual-column)

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

[](#installation)

Supports Laravel 10, 11, 12, and 13.

```
composer require stancl/virtualcolumn

```

Usage
-----

[](#usage)

Use the `VirtualColumn` trait on your model:

```
use Illuminate\Database\Eloquent\Model;
use Stancl\VirtualColumn\VirtualColumn;

class MyModel extends Model
{
    use VirtualColumn;

    public $guarded = [];

    public static function getCustomColumns(): array
    {
        return [
            'id',
            'custom1',
            'custom2',
        ];
    }
}
```

Create a migration:

```
public function up()
{
    Schema::create('my_models', function (Blueprint $table) {
        $table->increments('id');

        $table->string('custom1')->nullable();
        $table->string('custom2')->nullable();

        $table->json('data');
    });
}
```

And store any data on your model:

```
$myModel = MyModel::create(['foo' => 'bar']);
$myModel->update(['foo' => 'baz']);
```

###  Health Score

57

—

FairBetter than 98% of packages

Maintenance63

Regular maintenance activity

Popularity61

Solid adoption and visibility

Community28

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 53.8% 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 ~211 days

Total

9

Last Release

493d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d62e0fd56f0d6c0e97a7e62e82dc753de23ad9e32f7d78741118d6cb089d697c?d=identicon)[stancl](/maintainers/stancl)

---

Top Contributors

[![stancl](https://avatars.githubusercontent.com/u/33033094?v=4)](https://github.com/stancl "stancl (21 commits)")[![lukinovec](https://avatars.githubusercontent.com/u/34375937?v=4)](https://github.com/lukinovec "lukinovec (11 commits)")[![stein-j](https://avatars.githubusercontent.com/u/44996807?v=4)](https://github.com/stein-j "stein-j (3 commits)")[![abrardev99](https://avatars.githubusercontent.com/u/54532330?v=4)](https://github.com/abrardev99 "abrardev99 (2 commits)")[![22Nick22](https://avatars.githubusercontent.com/u/13195384?v=4)](https://github.com/22Nick22 "22Nick22 (1 commits)")[![andresayej](https://avatars.githubusercontent.com/u/38343686?v=4)](https://github.com/andresayej "andresayej (1 commits)")

### Embed Badge

![Health badge](/badges/stancl-virtualcolumn/health.svg)

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

###  Alternatives

[mongodb/laravel-mongodb

A MongoDB based Eloquent model and Query builder for Laravel

7.1k8.4M96](/packages/mongodb-laravel-mongodb)[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M345](/packages/psalm-plugin-laravel)[yajra/laravel-oci8

Oracle DB driver for Laravel via OCI8

8793.2M25](/packages/yajra-laravel-oci8)[kirschbaum-development/eloquent-power-joins

The Laravel magic applied to joins.

1.6k32.6M46](/packages/kirschbaum-development-eloquent-power-joins)[glushkovds/phpclickhouse-laravel

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

2051.5M2](/packages/glushkovds-phpclickhouse-laravel)[api-platform/laravel

API Platform support for Laravel

58171.5k14](/packages/api-platform-laravel)

PHPackages © 2026

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