Laravel ShareLink provides a comprehensive solution for generating and managing secure, temporary share links. Designed for seamless integration into Laravel applications, this package facilitates sharing of files, routes, and model previews while offering advanced features like time limitations and password protection.
Laravel ShareLink is an advanced package designed to facilitate the generation, management, and secure sharing of temporary links for files, routes, and model previews within Laravel applications. This powerful tool not only simplifies the sharing process but also enhances security and provides comprehensive auditing capabilities.
Key Features
- Multiple Resource Types: Effortlessly share files, routes, and model previews.
- Time-Limited Access: Configure expiration dates and usage limits for shared links.
- Password Protection: Implement optional passwords for added security.
- Rate Limiting: Safeguard against abuse with per-token rate limiting.
- IP Filtering: Customize access by allowing or denying specific IP addresses or CIDR ranges.
- Signed URLs: Integrate with Laravel's signed route functionality for further security.
- Burn After Reading: Utilize one-time access links that self-destruct post-usage.
- Comprehensive Auditing: Monitor access patterns, including IP addresses and timestamps.
- Advanced Security Features: Protect links with password throttling and brute force prevention.
- Flexible Delivery Methods: Support for X-Sendfile, X-Accel-Redirect, and streaming.
- Management API: Programmatically revoke and extend links as needed.
- CLI Commands: Full Artisan command line support for easy management.
- Test-Friendly Environment: Built for comprehensive test coverage with straightforward mocking capabilities.
Quick Start
Basic Usage Example
use Grazulex\ShareLink\Facades\ShareLink;
// Create a file share link with expiration and password
$link = ShareLink::create('/path/to/document.pdf')
->expiresIn(60) // 60 minutes expiration
->maxClicks(5)
->withPassword('secret123')
->generate();
echo $link->url; // Outputs the generated share link
File Sharing Example
// Share a local file
$link = ShareLink::create('/storage/documents/report.pdf')
->expiresIn(1440) // 24 hours expiration
->maxClicks(10)
->generate();
Advanced Security Features Example
// Create a burn-after-reading link with IP restrictions
$link = ShareLink::create('/secure/document.pdf')
->expiresIn(60)
->burnAfterReading() // Self-destructs after first access
->metadata([
'allowed_ips' => ['192.168.1.0/24'],
'denied_ips' => ['192.168.1.100']
])
->generate();
Documentation
For additional information, detailed usage instructions, and further resources, please refer to the Laravel ShareLink Wiki.
This package is optimized for performance and security, making it an essential tool for any Laravel developer looking to implement robust sharing features in their applications. With features such as rate limiting, password protection, and comprehensive auditing, Laravel ShareLink ensures a secure sharing experience tailored to the needs of modern applications.
No comments yet.
Sign in to be the first to comment.