linky / tracker-package
Linky tracking package for Laravel
Installs: 5
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/linky/tracker-package
Requires
- php: >=7.4
- guzzlehttp/guzzle: ^7.8
- illuminate/http: ^8.0|^9.0|^10.0|^11.0|^12.0
- illuminate/support: ^8.0|^9.0|^10.0|^11.0|^12.0
README
๐ Linky Tracker Package
Automatic Link Visit Tracking & Donation Reporting for Laravel
Track visits and donations effortlessly โ No JavaScript required!
โจ 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
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)
composer require linky/tracker-package
โ๏ธ Configuration
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
Add these variables to your .env file:
LINKY_ENDPOINT=https://linky.sadah.io/api/webhook LINKY_TOKEN=l76qYiQMpXotwgS6EPU5teFLibROSjXKNlJaChvh
๐ฏ Usage
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
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)
To ensure tracking doesn't slow down your application:
-
Configure a queue driver in
config/queue.php:QUEUE_CONNECTION=database # or redis
-
Run migrations (if using database queue):
php artisan queue:table php artisan migrate
-
Start the queue worker:
php artisan queue:work
๐ Quick Start Guide
| Step | Command |
|---|---|
| 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
In Your Controller
<?php namespace App\Http\Controllers; use Linky; class PaymentController extends Controller { public function handlePayment(Request $request) { // Process payment... // Track donation (one line) Linky::donation([ 'referral_code' => $request->referral_code, 'amount' => $request->amount, 'donor_name' => $request->name, 'donor_email' => $request->email, 'transaction_id' => $transaction->id, 'payment_method' => 'stripe', ]); return redirect()->route('thank-you'); } }
๐ ๏ธ Requirements
- PHP 7.4 or higher
- Laravel 8.0 to 12.x
- Composer
๐ License
This package is open-sourced software licensed under the MIT license.
Made with โค๏ธ for the Laravel Community
```