2017 © Pedro Peláez
 

library laravel-eloquent-meta

Meta data framework for Laravel's eloquent models.

image

boxed-code/laravel-eloquent-meta

Meta data framework for Laravel's eloquent models.

  • Tuesday, February 16, 2016
  • by olsgreen
  • Repository
  • 2 Watchers
  • 2 Stars
  • 50 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

Eloquent Meta

Eloquent meta provides an easy way to implement schemaless meta data stores for Eloquent models., (*1)

Scrutinizer Code Quality Code Coverage Build Status, (*2)

Installation

Add the package via composer:, (*3)

composer require boxed-code/laravel-eloquent-meta

then add the following line to the providers key within your config/app.php file:, (*4)

BoxedCode\Eloquent\Meta\MetaServiceProvider::class

You can then create a meta table migration using the artisan command:, (*5)

php artisan make:meta-migration

and then call migrate, (*6)

php artisan migrate

Basic Usage

There are two main methods of enabling a meta store on your models:, (*7)

Using the Metable trait

The Metable trait adds the basic meta store relation to your model so that it can be accessed like:, (*8)

class MyModel extends Model
{
    use Metable;
}

...

$model = new MyModel();

// Access via magic accessors on the meta collection.

$model->meta->foo = 'bar';

echo $model->meta->foo; // prints 'bar'

// Access via the collection

$item = $model->meta->whereKey('foo')->first();

echo $item; // prints 'bar'

Using the FluentMeta trait

The FluentMeta trait enables meta access on the model directly like:, (*9)


use BoxedCode\Eloquent\Meta\FluentMeta; use Illuminate\Database\Eloquent\Model; class MyModel extends Model { use FluentMeta; } ... $model = new MyModel(); // Access via magic accessors on the model. $model->foo = 'bar'; echo $model->foo; // prints 'bar' // Access via the collection $item = $model->meta->whereKey('foo')->first(); echo $item; // prints 'bar'

License

See the attached license file., (*10)

The Versions

16/02 2016

dev-master

9999999-dev

Meta data framework for Laravel's eloquent models.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Oliver Green

laravel eloquent model data metadata meta

16/02 2016

1.0.1

1.0.1.0

Meta data framework for Laravel's eloquent models.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Oliver Green

laravel eloquent model data metadata meta

10/02 2016

dev-2.0-dev

dev-2.0-dev

Meta data framework for Laravel's eloquent models.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Oliver Green

laravel eloquent model data metadata meta

12/01 2016

1.0.0

1.0.0.0

Meta data framework for Laravel's eloquent models.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Oliver Green

laravel eloquent model data metadata meta