orlyapps/laravel-event-tracking

Event Tracking per Model and with API

3.0 2022-03-15 05:26 UTC

This package is auto-updated.

Last update: 2024-09-15 10:45:44 UTC


README

Latest Version on Packagist Quality Score Total Downloads

Simple Event Tracking for Mobile Apps

Installation

You can install the package via composer:

composer require orlyapps/laravel-event-tracking
php artisan vendor:publish --provider="Orlyapps\LaravelEventTracking\LaravelEventTrackingServiceProvider" --tag="config"
php artisan vendor:publish --provider="Orlyapps\LaravelEventTracking\LaravelEventTrackingServiceProvider" --tag="migrations"
// User.php
class User extends Authenticatable
{
    use HasEventTracking;
}

// api.php
LaravelEventTracking::routes();

Usage

$user->track('first_login', ['my-meta-key' => 'my meta value'])
fetch("http://laravel.test/api/events", {
    headers: {
        accept: "application/json, text/plain, */*",
        "accept-language": "de",
        authorization:
            "Bearer 9|mrHe15eBQkGejPtXXbZ8VB4yVczhFD8fDHmObjQgskEk7f5G1dW1LbqIBQ2MjZWP6xhhniHRpxhNaZm0",
        "content-type": "application/json",
    },
    body: '{"name":"first_login","my-meta-key":{"code":"my meta value"}}',
    method: "POST",
    mode: "cors",
});

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email info@orlyapps.de instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.