Download the PHP package shammaa/laravel-url-shortener without Composer
On this page you can find all versions of the php package shammaa/laravel-url-shortener. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download shammaa/laravel-url-shortener
More information about shammaa/laravel-url-shortener
Files in shammaa/laravel-url-shortener
Package laravel-url-shortener
Short Description Professional URL shortener for Laravel with password protection, QR codes, advanced analytics, UTM tracking, and much more
License MIT
Homepage https://github.com/shammaa/laravel-url-shortener
Informations about the package laravel-url-shortener
Laravel URL Shortener
A professional, feature-rich URL shortener package for Laravel with password protection, QR codes, advanced analytics, hidden UTM tracking, and much more.
Features
- 🔒 Password Protection - Protect your links with passwords
- 📊 Advanced Analytics - Track clicks, locations, devices, browsers, and more
- 🎯 Hidden UTM Tracking - Track UTM parameters without showing them in URLs
- 📱 QR Code Generation - Automatic QR code generation for all links
- ⏰ Link Expiry - Set expiration dates for links
- 🔢 Click Limits - Limit the number of clicks per link
- 🌍 Geographic Tracking - Track visitor locations (country, city)
- 📱 Device Tracking - Track devices, browsers, platforms
- 🔗 Custom Domains - Use custom domains for shortened URLs
- 🚀 High Performance - Optimized with caching
- 🔌 API Support - Full REST API included
- 📈 Real-time Analytics - Real-time visit tracking
- 🎨 Professional UI - Beautiful password protection page
- 🔗 Model Integration - Automatic short links for Eloquent models
Installation
Publish configuration and migrations:
Quick Start
Basic Usage
Using Helper Function
Features in Detail
Password Protection
Users will be prompted for a password when accessing the link. The password is verified in session, so they don't need to enter it again.
QR Code Generation
QR codes are automatically generated for all links:
Hidden UTM Tracking
Track UTM parameters without showing them in the URL:
The UTM parameters will be tracked in analytics but won't appear in the destination URL.
Link Expiry
Click Limits
Advanced Analytics
The package automatically tracks:
- Total clicks
- Unique visitors (by IP)
- Geographic location (country, city)
- Device types (desktop, mobile, tablet)
- Browsers and platforms
- Referrers
- UTM parameters
- Time-based statistics
Access analytics:
Using with Models
The HasShortLink trait automatically creates short links for any Eloquent model with a model prefix + random code format (e.g., post-xyz1, article-abc2).
Basic Usage
How It Works
- Extracts model name →
Postbecomespost - Generates random code →
xyz1(4 characters by default) - Combines them →
post-xyz1 - Ensures uniqueness → Checks database and regenerates if needed
Key Format
The trait generates keys in format: {model-name}-{random-code}
Custom Prefix
You can customize the prefix using a database field or method:
Option 1: Database Field
Option 2: Override Method
Priority Order:
- Custom field:
short_link_prefix - Custom method:
getShortLinkPrefix() - Model name: Auto-extracted (default)
Custom Destination URL
Automatic Creation
Create short links automatically when model is created:
Complete Example
Configuration
Customize random code length:
API Usage
Endpoints
Configuration
Edit config/url-shortener.php:
Performance
- Smart Caching - Links are cached for fast retrieval
- Optimized Queries - Efficient database queries with proper indexing
- Minimal Overhead - Lightweight tracking with minimal performance impact
License
MIT
Author
Shadi Shammaa
Support
For issues and feature requests, please use the GitHub issue tracker.
All versions of laravel-url-shortener with dependencies
illuminate/support Version ^9.0|^10.0|^11.0|^12.0
illuminate/http Version ^9.0|^10.0|^11.0|^12.0
illuminate/database Version ^9.0|^10.0|^11.0|^12.0
illuminate/routing Version ^9.0|^10.0|^11.0|^12.0
illuminate/cache Version ^9.0|^10.0|^11.0|^12.0
illuminate/validation Version ^9.0|^10.0|^11.0|^12.0
simplesoftwareio/simple-qrcode Version ^4.2
jenssegers/agent Version ^2.6