2017 © Pedro Peláez
 

library laravel-smart-meta

this is meta data for any model that working with cache

image

alive2212/laravel-smart-meta

this is meta data for any model that working with cache

  • Saturday, May 12, 2018
  • by Alive2212
  • Repository
  • 1 Watchers
  • 1 Stars
  • 3 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

LaravelSmartMeta

Latest Version on Packagist ![Software License][ico-license] Build Status ![Coverage Status][ico-scrutinizer] Quality Score ![Total Downloads][ico-downloads], (*1)

This is Smart Meta for any model to assign expirable date to each of records., (*2)

Structure

If any of the following are applicable to your project, then the directory structure should follow industry best practices by being named the following., (*3)

src/
tests/

Install

Via Composer, (*4)

``` bash $ composer require alive2212/laravel-smart-meta, (*5)


## Usage 1- add trait to model ```php class User extends BaseAuthModel { use SmartMeta; }

2- to set meta to any model, should be done just following, (*6)

$user = (new User())->find(1);
$user->putCacheMeta("1","I'm Strong man");

3- Another methods to set metas are:, (*7)

// 1
$user->addCacheMeta("1","I'm String man");

// 2
$user->pushCacheMeta(["1","I'm String man"]);

4- Get metas methods are:, (*8)

// 1 get all metas
$metaParams = $user->getCacheMetas();

// 2 get one of meta by key
$metaParams = $user->getCacheMeta("key","default");

5- Delete, (*9)

// To delete all data
$user->deleteCacheMetas();

// TO delete one record
$user->deleteCacheMeta("key");

Change log

Please see CHANGELOG for more information on what has changed recently., (*10)

Testing

bash $ composer test, (*11)

Contributing

Please see CONTRIBUTING and CODE_OF_CONDUCT for details., (*12)

Security

If you discover any security related issues, please email alive2212@yahoo.com instead of using the issue tracker., (*13)

Credits

License

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

The Versions