this is meta data for any model that working with cache
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
This is Smart Meta for any model to assign expirable date to each of records.
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/
Via Composer
$ composer require alive2212/laravel-smart-meta
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");
Please see CHANGELOG for more information on what has changed recently.
$ composer test
Please see CONTRIBUTING and CODE_OF_CONDUCT for details.
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.