PHPackages                             linky/tracker-package - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. linky/tracker-package

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

linky/tracker-package
=====================

Linky tracking package for Laravel

v1.1.1(3mo ago)07MITPHPPHP &gt;=7.4

Since Feb 20Pushed 3mo agoCompare

[ Source](https://github.com/spectra10008/linky-tracker)[ Packagist](https://packagist.org/packages/linky/tracker-package)[ RSS](/packages/linky-tracker-package/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (3)Versions (4)Used By (0)

🔗 Linky Tracker Package
=======================

[](#-linky-tracker-package)

### Automatic Link Visit Tracking &amp; Donation Reporting for Laravel

[](#automatic-link-visit-tracking--donation-reporting-for-laravel)

[![Laravel](https://camo.githubusercontent.com/0072036e58c7fcec9a5276f344eb5f8ff0cd62dd0a14609a4767ef0d0a397d57/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c2d38253230746f25323031322d4646324432303f7374796c653d666f722d7468652d6261646765266c6f676f3d6c61726176656c266c6f676f436f6c6f723d7768697465)](https://laravel.com)[![PHP](https://camo.githubusercontent.com/b6a1f91b951d020474e6f9c4d696ba54d898bdd5f1b337dd3f0b6db4e790c201/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d372e342b2d3737374242343f7374796c653d666f722d7468652d6261646765266c6f676f3d706870266c6f676f436f6c6f723d7768697465)](https://php.net)[![License](https://camo.githubusercontent.com/153acf9dff19deb8abfc598c53bac50a4ceae0f5c83a552711060d3d78d2c057/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d677265656e3f7374796c653d666f722d7468652d6261646765)](LICENSE)[![Version](https://camo.githubusercontent.com/f5911c83548bb2142d2e496c1cc3f403054309e06ca3b2a8604d006be0bea0a9/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f56657273696f6e2d312e312e302d626c75653f7374796c653d666f722d7468652d6261646765)](https://github.com/spectra10008/linky-tracker/releases)

*Track visits and donations effortlessly — No JavaScript required!*

---

✨ Features
----------

[](#-features)

- 🚀 **Zero-Config Visit Tracking** — Automatically tracks all GET requests
- 📊 **One-Line Donation Reporting** — Simple facade for payment tracking
- ⚡ **Async Processing** — Uses Laravel Queue for optimal performance
- 🔧 **Fully Configurable** — Customize via environment variables
- 🎯 **No JavaScript** — Pure server-side tracking
- 🔄 **Auto-Registered Middleware** — Works immediately after installation

---

📦 Installation
--------------

[](#-installation)

### Option 1: Install from GitHub (Recommended)

[](#option-1-install-from-github-recommended)

Add the repository to your project's `composer.json`:

```
{
    "repositories": [
        {
            "type": "vcs",
            "url": "https://github.com/spectra10008/linky-tracker.git"
        }
    ],
    "require": {
        "linky/tracker-package": "^1.0"
    }
}
```

Then install via Composer:

```
composer require linky/tracker-package:^1.0
```

### Option 2: Install from Packagist (Coming Soon)

[](#option-2-install-from-packagist-coming-soon)

```
composer require linky/tracker-package
```

---

⚙️ Configuration
----------------

[](#️-configuration)

### 1. Publish Configuration File

[](#1-publish-configuration-file)

Publish the config file to customize settings:

```
php artisan vendor:publish --tag=config
```

This will create `config/linky.php`.

### 2. Environment Variables

[](#2-environment-variables)

Add these variables to your `.env` file:

```
LINKY_ENDPOINT=https://linky.sadah.io/api/webhook
LINKY_TOKEN=l76qYiQMpXotwgS6EPU5teFLibROSjXKNlJaChvh
```

---

🎯 Usage
-------

[](#-usage)

### Automatic Visit Tracking

[](#automatic-visit-tracking)

**No code needed!** All GET requests are automatically tracked once the package is installed.

- ✅ Tracks page visits automatically
- ✅ Sends data asynchronously via Laravel Queue
- ✅ No performance impact on your application

### Donation Tracking

[](#donation-tracking)

Report donations with a single line of code:

```
use Linky;

Linky::donation([
    'referral_code' => 'ABC123',
    'amount' => 500,
    'donor_name' => 'John Doe',
    'donor_email' => 'john@example.com',
    'transaction_id' => 'TXN123456789',
    'payment_method' => 'credit_card',
]);
```

**That's it!** No JavaScript, no complex setup — just one line.

---

🔄 Queue Setup (Recommended)
---------------------------

[](#-queue-setup-recommended)

To ensure tracking doesn't slow down your application:

1. **Configure a queue driver** in `config/queue.php`:

    ```
    QUEUE_CONNECTION=database  # or redis
    ```
2. **Run migrations** (if using database queue):

    ```
    php artisan queue:table
    php artisan migrate
    ```
3. **Start the queue worker**:

    ```
    php artisan queue:work
    ```

---

📋 Quick Start Guide
-------------------

[](#-quick-start-guide)

StepCommand**1. Install**`composer require linky/tracker-package:^1.0`**2. Publish Config**`php artisan vendor:publish --tag=config`**3. Set Environment**Add `LINKY_ENDPOINT` and `LINKY_TOKEN` to `.env`**4. Start Queue**`php artisan queue:work`**5. Done!**Visits are tracked automatically ✅---

💡 Example Usage
---------------

[](#-example-usage)

### In Your Controller

[](#in-your-controller)

```
