PHPackages                             sdavis1902/eloquent-vars - 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. sdavis1902/eloquent-vars

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

sdavis1902/eloquent-vars
========================

Add ability to save additional fields or Vars on a Laravel model without a specific db column for it

v2.0.2(8mo ago)113.1k↓19.6%1MITPHPPHP ^8.1

Since Jul 27Pushed 8mo ago1 watchersCompare

[ Source](https://github.com/sdavis1902/eloquent-vars)[ Packagist](https://packagist.org/packages/sdavis1902/eloquent-vars)[ Docs](https://github.com/sdavis1902/eloquent-vars)[ RSS](/packages/sdavis1902-eloquent-vars/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (5)Versions (9)Used By (0)

Eloquent Vars
=============

[](#eloquent-vars)

[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Total Downloads](https://camo.githubusercontent.com/b9e01099445e82421c829189c841de85a257f0092e1d1033fd6580940ce8199c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f736461766973313930322f656c6f7175656e742d766172732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/sdavis1902/eloquent-vars)

Add ability to save additional fields or Vars on a Laravel model without a specific db column for it

Install
-------

[](#install)

Via Composer

```
$ composer require sdavis1902/eloquent-vars
```

Add the service provider ( not required for 5.5 )

```
sdavis1902\EloquentVars\EloquentVarsServiceProvider::class,
```

Publish and run migration

```
$ php artisan vendor:publish --provider="sdavis1902\EloquentVars\EloquentVarsServiceProvider"
$ php artisan migrate
```

Usage
-----

[](#usage)

Add the trait to your model

```
