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)826.8M—1.6%14[1 PRs](https://github.com/archtechx/virtualcolumn/pulls)10MITPHPCI passing

Since Jul 6Pushed 2mo ago4 watchersCompare

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

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

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

58

—

FairBetter than 98% of packages

Maintenance68

Regular maintenance activity

Popularity60

Solid adoption and visibility

Community28

Small or concentrated contributor base

Maturity62

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

447d 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

[cybercog/laravel-love

Make Laravel Eloquent models reactable with any type of emotions in a minutes!

1.2k302.7k1](/packages/cybercog-laravel-love)[cviebrock/eloquent-taggable

Easy ability to tag your Eloquent models in Laravel.

567694.8k3](/packages/cviebrock-eloquent-taggable)[clickbar/laravel-magellan

This package provides functionality for working with the postgis extension in Laravel.

423715.4k1](/packages/clickbar-laravel-magellan)[genealabs/laravel-pivot-events

This package introduces new eloquent events for sync(), attach(), detach() or updateExistingPivot() methods on BelongsToMany relation.

1404.9M8](/packages/genealabs-laravel-pivot-events)[reedware/laravel-relation-joins

Adds the ability to join on a relationship by name.

2121.2M13](/packages/reedware-laravel-relation-joins)[aglipanci/laravel-eloquent-case

Adds CASE statement support to Laravel Query Builder.

115157.2k](/packages/aglipanci-laravel-eloquent-case)

PHPackages © 2026

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