LaravelPackages.net
Acme Inc.
Toggle sidebar
alive2212/laravel-smart-meta

this is meta data for any model that working with cache

17
2
v1.0.1
About alive2212/laravel-smart-meta

alive2212/laravel-smart-meta is a Laravel package for this is meta data for any model that working with cache. It currently has 2 GitHub stars and 17 downloads on Packagist (latest version v1.0.1). Install it with composer require alive2212/laravel-smart-meta. Discover more Laravel packages by alive2212 or browse all Laravel packages to compare alternatives.

Last updated

LaravelSmartMeta

Latest Version on Packagist Software License Build Status Coverage Status Quality Score Total Downloads

This is Smart Meta for any model to assign expirable date to each of records.

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.

src/
tests/

Install

Via Composer

$ composer require alive2212/laravel-smart-meta

Usage

1- add trait to model

class User extends BaseAuthModel
{
    use SmartMeta;
}

2- to set meta to any model, should be done just following

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

3- Another methods to set metas are:

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

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

4- Get metas methods are:

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

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

5- Delete

// 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.

Testing

$ composer test

Contributing

Please see CONTRIBUTING and CODE_OF_CONDUCT for details.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

License

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

Comments