primefaceshero / mobile-traffic-meter
Mobile Traffic Meter - Package that allows to obtain the traffic by views of a mobile application for reporting
Installs: 17
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
Language:Blade
Requires
- php: >=5.4.0
- illuminate/support: 4.2.*|5.*|^6.0|^7.0|^8.0|^9.0
Requires (Dev)
- orchestra/testbench: 3.7.*|^7.0
- phpunit/phpunit: ^7|^9.5.10
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.