2017 © Pedro Peláez
 

library laravel-meta

Model meta

image

appstract/laravel-meta

Model meta

  • Monday, January 22, 2018
  • by gizburdt
  • Repository
  • 3 Watchers
  • 72 Stars
  • 4,223 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 3 Forks
  • 1 Open issues
  • 12 Versions
  • 14 % Grown

The README.md

Laravel Meta

Latest Version on Packagist Total Downloads Software License Build Status, (*1)

Metadata for your Eloquent model, (*2)

Installation

You can install the package via composer:, (*3)

composer require appstract/laravel-meta

Publish, migrate

By running php artisan vendor:publish --provider="Appstract\Meta\MetaServiceProvider" in your project all files for this package will be published. For this package, it's only a migration. Run php artisan migrate to migrate the table. There will now be a table named metas in your database., (*4)

Usage

You can easily add Meta to an Eloquent model. Just add this to your model:, (*5)

use Appstract\Meta\Metable;

class Book extends Model
{
    use Metable;
}

Then you can get, add, update and delete meta to the model., (*6)

$book = Book::find(1);

$book->addMeta('someKey', 'someValue');

$book->getMeta('someKey');

$book->getMetaValue('someKey');

$book->hasMeta('someKey');

$book->updateMeta('someKey', 'anotherValue');

$book->addOrUpdateMeta('someKey', 'someValue');

$book->deleteMeta('someKey');

$book->getAllMeta();

$book->deleteAllMeta();

Testing

$ composer test

Contributing

Contributions are welcome, thanks to y'all :), (*7)

About Appstract

Appstract is a small team from The Netherlands. We create (open source) tools for webdevelopment and write about related subjects on Medium. You can follow us on Twitter, buy us a beer or support us on Patreon., (*8)

License

The MIT License (MIT). Please see License File for more information., (*9)

The Versions

22/01 2018

dev-master

9999999-dev https://github.com/appstract/laravel-meta

Model meta

  Sources   Download

MIT

The Requires

  • php >=5.6

 

The Development Requires

appstract laravel-meta

22/01 2018

1.0.0

1.0.0.0 https://github.com/appstract/laravel-meta

Model meta

  Sources   Download

MIT

The Requires

  • php >=5.6

 

The Development Requires

appstract laravel-meta

21/08 2017

0.2.0

0.2.0.0 https://github.com/appstract/laravel-meta

Model meta

  Sources   Download

MIT

The Requires

  • php >=5.6

 

The Development Requires

appstract laravel-meta

17/06 2017

0.1.0

0.1.0.0 https://github.com/appstract/laravel-meta

Model meta

  Sources   Download

MIT

The Requires

  • php >=5.6

 

The Development Requires

appstract laravel-meta

10/05 2017

0.0.8

0.0.8.0 https://github.com/appstract/laravel-meta

Model meta

  Sources   Download

MIT

The Requires

  • php >=5.6

 

The Development Requires

appstract laravel-meta

10/05 2017

0.0.7

0.0.7.0 https://github.com/appstract/laravel-meta

Model meta

  Sources   Download

MIT

The Requires

  • php >=5.6

 

The Development Requires

appstract laravel-meta

05/05 2017

0.0.6

0.0.6.0 https://github.com/appstract/laravel-meta

Model meta

  Sources   Download

MIT

The Requires

  • php >=5.6

 

The Development Requires

appstract laravel-meta

05/05 2017

0.0.5

0.0.5.0 https://github.com/appstract/laravel-meta

Model meta

  Sources   Download

MIT

The Requires

  • php >=5.6

 

The Development Requires

appstract laravel-meta

04/05 2017

0.0.4

0.0.4.0 https://github.com/appstract/laravel-meta

Model meta

  Sources   Download

MIT

The Requires

  • php >=5.6

 

The Development Requires

appstract laravel-meta

04/05 2017

0.0.3

0.0.3.0 https://github.com/appstract/laravel-meta

Model meta

  Sources   Download

MIT

The Requires

  • php >=5.6

 

The Development Requires

appstract laravel-meta

04/05 2017

0.0.2

0.0.2.0 https://github.com/appstract/laravel-meta

Model meta

  Sources   Download

MIT

The Requires

  • php >=5.6

 

The Development Requires

appstract laravel-meta

04/05 2017

0.0.1

0.0.1.0 https://github.com/appstract/laravel-meta

Model meta

  Sources   Download

MIT

The Requires

  • php >=5.6

 

The Development Requires

appstract laravel-meta