承接 sweeeeep/l5popularity 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

sweeeeep/l5popularity

Composer 安装命令:

composer require sweeeeep/l5popularity

包简介

Laravel Package for Tracking popular item in Eloquent models

README 文档

README

Based on marcanuy/popularity

Latest Version on Packagist Total Downloads Build Status StyleCI

This is where your description should go. Take a look at contributing.md to see a to do list.

Installation

Via Composer

$ composer require sweeeeep/l5popularity

Updating your Eloquent Models

Your model should use the Popularable traits, which has method hit() that you need use

  <?php
  
    use Sweeeeep\Popularity\Popularable;
    
    class Post extends Model
    {
      use Popularable;
      
    }

Usage

It makes use of Eloquent's polymorphic relations , so each tracked model has its own stats.

Tracking Hits

For each model instance that has already been saved into the db (or already has an id), call hit() method to increase count for each time frame, e.g. in routes.php each time a post or an article is viewed, or an Eloquent event is fired.

$post = Post::find(1);
$post->hit();

Change log

Please see the changelog for more information on what has changed recently.

Contributing

Please see contributing.md for details and a todolist.

License

license. Please see the license file for more information.

统计信息

  • 总下载量: 86
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-07-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固