m74asoud/temptag
Composer 安装命令:
composer require m74asoud/temptag
包简介
Laravel Temporary Tag for tagging Eloquent models - store in mongodb
README 文档
README
Auto-expiring tags with additional payload data on any eloquent model.
Installation
first you need to install and configure mongodb in your laravel project with jenssegers/laravel-mongodb, then install package m74asoud/temptag with below command
composer require m74asoud/temptag
migrate table
php artisan migrate
Configure Model
use M74asoud\TempTag\Traits\TempTagAble; class User extend Model { use TempTagAble; protected $connection = 'mysql'; protected $table = 'users'; }
Usage
$user->tempTagService() ->tagIt( string $title, $payload = null, Carbon $expire_at = null ): TempTag $user->tempTagService()->unTag(string $title) $user->tempTagService()->unTagID($ID) $user->tempTagService()->get(string $title): EloquentCollection $user->tempTagService()->getOne(string $title): ?TempTag $user->tempTagService()->getOneID($ID): ?TempTag $user->tempTagService()->all(): EloquentCollection ... and another method,complete readme file comming soon
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
License
统计信息
- 总下载量: 4
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-09-16