Download the PHP package cndrsdrmn/short-url without Composer
On this page you can find all versions of the php package cndrsdrmn/short-url. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package short-url
Short URL Package
A lightweight and flexible Laravel package for generating and managing short URLs. This package simplifies the process of creating short links with customizable options, middleware, and bot protection.
Features
- 📏 Customizable token formats and lengths: Choose from mixed, numeric, or alphabetic tokens.
- 🛡 Bot protection: Optionally block requests from known bots.
- ⚡ Quick setup: Easily integrate into existing Laravel projects.
- 🔒 Token encryption: Secure your tokens with a custom encryption callback.
- 🎛 Middleware support: Add custom middleware to short URL routes.
Installation
Install the package via Composer:
Configuration
Publish the configuration file:
The configuration file config/short-url.php will be published. It includes the following options:
Usage
Basic Usage
Shorten a URL
You can easily generate a short URL with the ShortUrl facade:
Advanced Usage
Customizing the Builder
Customize your short URL with the make method:
Setting Custom Headers and Queries
Routes
By default, the package automatically registers a route for handling short URL redirections. If you want to customize the routing:
-
Disable route registration on boot in
App\Providers\AppServiceProvider: - Define your own route in
routes/web.php:
Security
Encrypt Tokens
Set a custom encryption callback to secure your tokens:
Testing
Run the tests with PHPUnit:
License
This package is open-sourced software licensed under the MIT license.
Contributing
Contributions are welcome! Please see more detail on CONTRIBUTING.md.
Credits
- Author: Candra Sudirman
- Inspired by: URL shortening services like Bitly.
All versions of short-url with dependencies
cndrsdrmn/eloquent-unique-attributes Version ^0.1
matomo/device-detector Version ^6.4