PHPackages                             grazulex/laravel-sharelink - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. grazulex/laravel-sharelink

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

grazulex/laravel-sharelink
==========================

Generate, manage, and secure temporary share links for files, routes, and model previews.

V1.2.0(7mo ago)121981↑125%2[3 issues](https://github.com/Grazulex/laravel-sharelink/issues)MITPHPPHP ^8.3CI passing

Since Aug 8Pushed 6mo agoCompare

[ Source](https://github.com/Grazulex/laravel-sharelink)[ Packagist](https://packagist.org/packages/grazulex/laravel-sharelink)[ Docs](https://github.com/grazulex/laravel-sharelink)[ Fund](https://paypal.me/strauven)[ GitHub Sponsors](https://github.com/Grazulex)[ RSS](/packages/grazulex-laravel-sharelink/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)DependenciesVersions (4)Used By (0)

Laravel ShareLink
=================

[](#laravel-sharelink)

 [![Laravel ShareLink](https://raw.githubusercontent.com/Grazulex/laravel-sharelink/main/new_logo.png)](https://raw.githubusercontent.com/Grazulex/laravel-sharelink/main/new_logo.png)**Generate, manage, and secure temporary share links for files, routes, and models**

*A powerful Laravel package for creating secure, time-limited sharing capabilities with comprehensive audit trails*

[![Latest Version](https://camo.githubusercontent.com/ffa5758a1aa06f96f337880443b511eab54ee441e71c245c7248a176733095b1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6772617a756c65782f6c61726176656c2d73686172656c696e6b2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/grazulex/laravel-sharelink)[![Total Downloads](https://camo.githubusercontent.com/e005fb84f4b61a966cc376af4158db0a74e551cd20651b71132e1e1b2b58c50a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6772617a756c65782f6c61726176656c2d73686172656c696e6b2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/grazulex/laravel-sharelink)[![License](https://camo.githubusercontent.com/8dca80339b444fd2850981aade55e45aa8d5911d555d5fa4ae842259d1ed14f7/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6772617a756c65782f6c61726176656c2d73686172656c696e6b2e7376673f7374796c653d666c61742d737175617265)](https://github.com/Grazulex/laravel-sharelink/blob/main/LICENSE.md)[![PHP Version](https://camo.githubusercontent.com/dd17caf54ba56d79b2394f3dde503bbe9581d6a359fc982ac7673ae8002688bf/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6772617a756c65782f6c61726176656c2d73686172656c696e6b2e7376673f7374796c653d666c61742d737175617265)](https://php.net/)[![Laravel Version](https://camo.githubusercontent.com/50a156743f40e3d269e0d6c04cd9c402cac1a50f075556139533a2ccad5ffdfb/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c61726176656c2d31312e7825323025374325323031322e782d6666326432303f7374796c653d666c61742d737175617265266c6f676f3d6c61726176656c)](https://laravel.com/)[![Tests](https://camo.githubusercontent.com/b5c1c00d31664cb72bf3c631df9db91ce0f6d9c3d992aa6a2423850fdb01a758/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6772617a756c65782f6c61726176656c2d73686172656c696e6b2f74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/Grazulex/laravel-sharelink/actions)[![Code Style](https://camo.githubusercontent.com/161d70e6871f808e0439b3e7a86540993ae98775540b5a2e78226000e3c419c7/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f636f64652532307374796c652d70696e742d3030303030303f7374796c653d666c61742d737175617265266c6f676f3d6c61726176656c)](https://github.com/laravel/pint)

---

🚀 Overview
----------

[](#-overview)

Laravel ShareLink is a comprehensive package for generating **secure**, **time-limited** sharing capabilities in your Laravel applications. Perfect for sharing files, creating temporary access to routes, or providing time-limited previews of model data with complete audit trails and advanced security features.

✨ Key Features
--------------

[](#-key-features)

- 🔗 **Multiple Resource Types** - Share files, routes, and model previews seamlessly
- ⏰ **Time-Limited Access** - Set expiration dates and usage limits
- 🔒 **Password Protection** - Optional password gates for enhanced security
- 🚫 **Rate Limiting** - Per-token rate limiting to prevent abuse
- 🌐 **IP Filtering** - Allow/deny specific IP addresses or CIDR ranges
- 🔏 **Signed URLs** - Optional Laravel signed route integration
- 🔥 **Burn After Reading** - One-time access links that self-destruct
- 📊 **Comprehensive Auditing** - Track access patterns, IPs, and timestamps
- 🛡️ **Advanced Security** - Password throttling, brute force protection
- 🎯 **Flexible Delivery** - Support for X-Sendfile, X-Accel-Redirect, and streaming
- 📋 **Management API** - Revoke and extend links programmatically
- 🎨 **CLI Commands** - Full Artisan command support
- 📈 **Observability** - Built-in logging and metrics integration
- 🧪 **Test-Friendly** - Comprehensive test coverage with easy mocking

📦 Installation
--------------

[](#-installation)

Install the package via Composer:

```
composer require grazulex/laravel-sharelink
```

Publish and run the migrations:

```
php artisan vendor:publish --tag="sharelink-migrations"
php artisan migrate
```

Optionally, publish the configuration file:

```
php artisan vendor:publish --tag="sharelink-config"
```

> **💡 Auto-Discovery**: The service provider will be automatically registered thanks to Laravel's package auto-discovery.

⚡ Quick Start
-------------

[](#-quick-start)

### 🚀 Basic Usage

[](#-basic-usage)

```
use Grazulex\ShareLink\Facades\ShareLink;

// Share a file with expiration
$link = ShareLink::create('/path/to/document.pdf')
    ->expiresIn(60) // 60 minutes
    ->maxClicks(5)
    ->withPassword('secret123')
    ->generate();

echo $link->url; // https://yourapp.com/share/abc123xyz
```

### 📁 File Sharing

[](#-file-sharing)

```
// Share a local file
$link = ShareLink::create('/storage/documents/report.pdf')
    ->expiresIn(1440) // 24 hours
    ->maxClicks(10)
    ->generate();

// Share via Laravel Storage
$link = ShareLink::create('s3://bucket/private/document.pdf')
    ->expiresIn(60)
    ->withPassword('secure')
    ->generate();
```

### 🌐 Route Sharing

[](#-route-sharing)

```
// Share a named route with parameters
$link = ShareLink::create([
    'type' => 'route',
    'route' => 'user.profile',
    'parameters' => ['user' => 123]
])
->expiresIn(120)
->generate();
```

### 📊 Model Preview

[](#-model-preview)

```
// Share a model preview (JSON representation)
$user = User::find(1);
$link = ShareLink::create([
    'type' => 'model',
    'class' => User::class,
    'id' => $user->id
])
->expiresIn(30)
->generate();
```

### 🔥 Advanced Security Features

[](#-advanced-security-features)

```
// 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', '10.0.0.1'],
        'denied_ips' => ['192.168.1.100']
    ])
    ->generate();

// Signed URL for extra security
$signedUrl = ShareLink::signedUrl($link, now()->addHour());
```

🔧 Requirements
--------------

[](#-requirements)

- **PHP 8.3+**
- **Laravel 11.0+ | 12.0+**

📚 Complete Documentation
------------------------

[](#-complete-documentation)

For comprehensive documentation, examples, and advanced usage guides, visit our **Wiki**:

### 📖 **[👉 Laravel ShareLink Wiki](https://github.com/Grazulex/laravel-sharelink/wiki)**

[](#--laravel-sharelink-wiki)

The wiki includes:

- **🚀 [Installation &amp; Setup](https://github.com/Grazulex/laravel-sharelink/wiki/Install)**
- **⚙️ [Configuration](https://github.com/Grazulex/laravel-sharelink/wiki/Configuration)**
- **🎯 [Quickstart Guide](https://github.com/Grazulex/laravel-sharelink/wiki/Quickstart)**
- **🌐 [API Endpoints](https://github.com/Grazulex/laravel-sharelink/wiki/Endpoints)**
- **📋 [API Reference](https://github.com/Grazulex/laravel-sharelink/wiki/API)**
- **🛡️ [Security Features](https://github.com/Grazulex/laravel-sharelink/wiki/Security)**
- **📡 [Events &amp; Observability](https://github.com/Grazulex/laravel-sharelink/wiki/Events)**
- **🎨 [CLI Commands](https://github.com/Grazulex/laravel-sharelink/wiki/CLI)**
- **📈 [Version Matrix](https://github.com/Grazulex/laravel-sharelink/wiki/Version-Matrix)**
- **📝 [Changelog](https://github.com/Grazulex/laravel-sharelink/wiki/Changelog)**

🎨 Artisan Commands
------------------

[](#-artisan-commands)

Laravel ShareLink includes powerful CLI commands for managing your share links:

```
# Create a new share link
php artisan sharelink:create /path/to/file --expires=60 --max-clicks=5

# List all share links
php artisan sharelink:list --active --expired

# Revoke a specific link
php artisan sharelink:revoke abc123xyz

# Clean up expired links
php artisan sharelink:prune --days=7
```

🔧 Configuration
---------------

[](#-configuration)

The package comes with sensible defaults, but you can customize everything:

```
// config/sharelink.php
return [
    'route' => [
        'prefix' => 'share',
        'middleware' => ['web'],
    ],

    'security' => [
        'signed_routes' => [
            'enabled' => true,
            'required' => false,
        ],
        'rate_limiting' => [
            'enabled' => true,
            'max_attempts' => 10,
        ],
        'password_throttling' => [
            'enabled' => true,
            'max_attempts' => 5,
        ],
    ],

    'delivery' => [
        'x_sendfile' => false,
        'x_accel_redirect' => false,
    ],
];
```

🧪 Testing
---------

[](#-testing)

```
composer test
```

🤝 Contributing
--------------

[](#-contributing)

Please see [CONTRIBUTING.md](CONTRIBUTING.md) for details.

🔒 Security
----------

[](#-security)

If you discover any security-related issues, please email **** instead of using the issue tracker.

📝 Changelog
-----------

[](#-changelog)

Please see the [Wiki Changelog](https://github.com/Grazulex/laravel-sharelink/wiki/Changelog) for more information on what has changed recently.

📄 License
---------

[](#-license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

👥 Credits
---------

[](#-credits)

- **[Jean-Marc Strauven](https://github.com/Grazulex)**
- **[All Contributors](../../contributors)**

💬 Support
---------

[](#-support)

- 🐛 **[Report Issues](https://github.com/Grazulex/laravel-sharelink/issues)**
- 💬 **[Discussions](https://github.com/Grazulex/laravel-sharelink/discussions)**
- 📖 **[Documentation](https://github.com/Grazulex/laravel-sharelink/wiki)**

---

 **Laravel ShareLink** - Secure, time-limited sharing for Laravel applications
 with comprehensive audit trails and advanced security features.

---

💼 Need Custom Laravel Solutions?
--------------------------------

[](#-need-custom-laravel-solutions)

Laravel ShareLink is maintained by **Jean-Marc Strauven**, creator of 17+ Laravel packages.

### 🚀 I Can Help With:

[](#-i-can-help-with)

**🔐 Secure File Sharing &amp; Access Control**

- Custom file management systems
- Advanced permission systems
- Temporary access solutions
- Integration with cloud storage (S3, Azure, etc.)

**📦 Custom Laravel Package Development**

- Build tailored packages for your specific needs
- Internal tools for your team
- Integration with third-party services
- **€5,000-€10,000** depending on complexity

**🏗️ Complete Laravel Applications**

- SaaS platforms
- Document management systems
- Collaboration tools
- **€8,000-€15,000** for MVP

### 👨‍💻 About Me:

[](#‍-about-me)

- 15+ years Laravel/PHP expertise
- Ex-CTO at Delcampe (millions of users)
- Chapter Lead at BNP Paribas Fortis
- 6,000+ package downloads across 17+ packages

### 📬 Let's Talk:

[](#-lets-talk)

- 📧
- 💼 [LinkedIn Profile](https://www.linkedin.com/in/jean-marc-strauven)
- 💻 [Available on Malt](https://www.malt.be)

💡 **Building a Laravel SaaS or need custom features?** I'd love to help bring your project to life.

---

⭐ Show Your Support
-------------------

[](#-show-your-support)

If Laravel ShareLink is useful for your project:

- Give it a ⭐ on GitHub
- Share it with other Laravel developers
- [Sponsor my work](https://github.com/sponsors/Grazulex) ❤️

###  Health Score

43

—

FairBetter than 91% of packages

Maintenance66

Regular maintenance activity

Popularity32

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~33 days

Total

3

Last Release

211d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/888105bd54b6b7f7905523a16a1d08eebc2e5d39b19a4c174b5961bb4d52929b?d=identicon)[Grazulex](/maintainers/Grazulex)

---

Top Contributors

[![Grazulex](https://avatars.githubusercontent.com/u/4521546?v=4)](https://github.com/Grazulex "Grazulex (33 commits)")

---

Tags

laravelpackagephproutesurl-shortenerlaraveltokensecuretemporarydownloadphp8signed-urlsharelink

### Embed Badge

![Health badge](/badges/grazulex-laravel-sharelink/health.svg)

```
[![Health](https://phpackages.com/badges/grazulex-laravel-sharelink/health.svg)](https://phpackages.com/packages/grazulex-laravel-sharelink)
```

###  Alternatives

[dirape/token

Unique Token Generator For Laravel

28277.4k2](/packages/dirape-token)[sbsaga/toon

🧠 TOON for Laravel — a compact, human-readable, and token-efficient data format for AI prompts &amp; LLM contexts. Perfect for ChatGPT, Gemini, Claude, Mistral, and OpenAI integrations (JSON ⇄ TOON).

6115.6k](/packages/sbsaga-toon)[shetabit/token-builder

Laravel Token Builder

236.7k](/packages/shetabit-token-builder)[kevinsimard/laravel-cookieless-session

Laravel middleware to start a cookieless session

1417.0k](/packages/kevinsimard-laravel-cookieless-session)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
