Download the PHP package intelfric/laravel-encrypted-route without Composer
On this page you can find all versions of the php package intelfric/laravel-encrypted-route. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download intelfric/laravel-encrypted-route
More information about intelfric/laravel-encrypted-route
Files in intelfric/laravel-encrypted-route
Package laravel-encrypted-route
Short Description A Laravel package that encrypts full route URLs for enhanced security and obfuscation
License MIT
Homepage https://github.com/intelfric/laravel-encrypted-route
Informations about the package laravel-encrypted-route
Laravel Encrypted Route
A Laravel package that encrypts full route URLs for enhanced security and obfuscation. Transform your readable URLs into encrypted, random-looking paths that maintain full functionality while hiding your application's structure.
Features
- 🔐 Full URL Encryption: Encrypt route names and parameters into unreadable strings
- ⏰ Time-based Expiry: Optional URL expiration with configurable TTL
- 🔄 Flexible Routing: Choose between redirects or internal dispatch
- 🎯 Route Validation: Ensure only valid routes can be encrypted
- 🚀 Performance: Optional caching for decrypted routes
- 🛡️ Security: Built on Laravel's encryption system
- 📦 Easy Integration: Simple helper functions and Facade support
Example
Transform this:
Into this:
Installation
Install the package via Composer:
Laravel Auto-Discovery
Laravel 5.5+ automatically discovers the package. For older versions, add the service provider:
Publish Configuration
Configuration
The configuration file config/encryptedroute.php provides several options:
Usage
Basic Usage
Using Helper Function
Using Facade
Using Route Macro
Advanced Usage
Temporary URLs with Expiry
URL Validation
Using the Facade for Complex Operations
How It Works
-
URL Generation: When you call
encrypted_url(), the package:- Validates the route exists
- Encrypts the route name and parameters using Laravel's encryption
- Generates a URL with the encrypted data
-
URL Resolution: When a user visits an encrypted URL:
- The package decrypts the path
- Validates the route and checks expiry
- Either redirects to the original route or dispatches it internally
- Security: All encryption uses Laravel's built-in encryption system, ensuring your URLs are secure and tamper-proof.
Configuration Options
Route Behavior
Control how encrypted routes are handled:
URL Expiry
Set default expiry for all encrypted URLs:
Route Restrictions
Control which routes can be encrypted:
Performance
Enable caching for better performance:
Environment Variables
You can configure the package using environment variables:
Use Cases
1. Admin Panel Security
Hide admin routes from being easily discovered:
2. Temporary File Downloads
Create expiring download links:
3. Email Links
Generate secure links for emails:
4. API Endpoints
Obfuscate API endpoint structures:
Error Handling
The package handles various error scenarios:
- Invalid encrypted data: Returns 404
- Non-existent routes: Returns 404
- Expired URLs: Returns 404
- Excluded routes: Throws
InvalidArgumentException
Requirements
- PHP 8.1+
- Laravel 9.0+
Testing
The package includes comprehensive tests. To run them:
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Security
If you discover any security vulnerabilities, please email [email protected] instead of using the issue tracker.
License
The MIT License (MIT). Please see License File for more information.
Credits
- Dr Msigwa - [email protected]
- Intelfric Tech - intelfric.com
Changelog
Please see CHANGELOG for more information about what has changed recently.
Made with ❤️ by Intelfric Tech
All versions of laravel-encrypted-route with dependencies
illuminate/support Version ^9.0|^10.0|^11.0|^12.0
illuminate/routing Version ^9.0|^10.0|^11.0|^12.0
illuminate/encryption Version ^9.0|^10.0|^11.0|^12.0
illuminate/http Version ^9.0|^10.0|^11.0|^12.0