alive2212 / laravel-smart-meta
this is meta data for any model that working with cache
Requires
- php: ~5.6|~7.0
- illuminate/cache: ~5.1
- illuminate/database: *
- illuminate/support: ~5.1
Requires (Dev)
- illuminate/cache: ~5.1
- illuminate/container: *
- illuminate/database: *
- illuminate/support: ~5.1
- phpunit/phpunit: >=5.4.3
- squizlabs/php_codesniffer: ^2.3
This package is auto-updated.
Last update: 2024-10-17 03:34:34 UTC
README
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 alive2212@yahoo.com instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.