primefaceshero/mobile-traffic-meter
Composer 安装命令:
composer require primefaceshero/mobile-traffic-meter
包简介
Mobile Traffic Meter - Package that allows to obtain the traffic by views of a mobile application for reporting
README 文档
README
Package that allows to obtain the traffic by views of a mobile application for reporting
Built With
Installation
Via Composer
$ composer require primefaceshero/mobile-traffic-meter
Add Service Provider to config/app.php in providers section
Primefaceshero\MobileTrafficMeter\MobileTrafficMeterServiceProvider::class,
Make migration and Model
Schema::create('log_use_events', function (Blueprint $table) { $table->bigIncrements('id'); $table->string('event'); $table->integer('user_id')->nullable(); $table->timestamps(); });
<?php namespace App\Models; use Illuminate\Database\Eloquent\Model; class LogUseEvent extends Model { protected $fillable = [ 'event', 'user_id', 'created_at' ]; }
Seeder
Route::get('/faker/{count}', function ($count) { MobileTrafficMeter::faker($count); return "done"; });
Methods
use Primefaceshero\MobileTrafficMeter\MobileTrafficMeter;
Insert
| Param | Description |
|---|---|
| event | Name of the event (required) |
| user_id | User executing the event (optional) |
MobileTrafficMeter::insert($event, $user_id)
getAll
MobileTrafficMeter::getAll()
getByUser
| Param | Description |
|---|---|
| user_id | - (Required) |
MobileTrafficMeter::getByUser($user_id)
getByEvent
| Param | Description |
|---|---|
| event | - (Required) |
MobileTrafficMeter::getByEvent($event)
getByEventAndDate
| Param | Description |
|---|---|
| event | - (Required) |
| start_date | - (Required) |
| end_date | - (Required) |
MobileTrafficMeter::getByEventAndDate($event, $start_date, $end_date)
getByUserAndEvent
| Param | Description |
|---|---|
| event | - (Required) |
| user_id | - (Required) |
MobileTrafficMeter::getByUserAndEvent($user_id, $event)
getByDate
| Param | Description |
|---|---|
| start_date | - (Required) |
| end_date | - (Required) |
MobileTrafficMeter::getByEventAndDate($start_date, $end_date)
Usage
See the DemoController how to use the library to get information from the events
Contributing
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch
- Commit your Changes
- Push to the Branch
- Open a Pull Request
Credits
License
license. Please see the license file for more information.
统计信息
- 总下载量: 17
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 3
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-05-04