PHPackages                             shahadh/laravel-temporary-links - 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. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. shahadh/laravel-temporary-links

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

shahadh/laravel-temporary-links
===============================

Generate temporary, expiring access links for Laravel applications

v1.0.0(1y ago)065MITPHPPHP ^8.0

Since Mar 9Pushed 1y ago1 watchersCompare

[ Source](https://github.com/Shahadh7/laravel-temporary-links)[ Packagist](https://packagist.org/packages/shahadh/laravel-temporary-links)[ RSS](/packages/shahadh-laravel-temporary-links/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (4)Versions (2)Used By (0)

Laravel Temporary Access Links
==============================

[](#laravel-temporary-access-links)

A Laravel package for generating temporary, expiring access links for users to view/download content securely.

Features
--------

[](#features)

- ✅ **Time-Limited Links** – Links expire after a set time (e.g., 24 hours)
- ✅ **One-Time Use Links** – Restrict access to a single open/download
- ✅ **IP &amp; Device Restrictions** – Limit access to specific IPs or devices
- ✅ **Webhook Integration** – Get notified when a link is accessed

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require shahadh/laravel-temporary-links
```

Publish the migrations and config:

```
php artisan vendor:publish --tag="temporary-links-migrations"
php artisan vendor:publish --tag="temporary-links-config"
```

Run the migrations:

```
php artisan migrate
```

Usage
-----

[](#usage)

### Basic Usage

[](#basic-usage)

```
// Add the trait to your model
use Shahadh\TemporaryLinks\Traits\HasTemporaryLinks;

class Document extends Model
{
    use HasTemporaryLinks;
}

// Create a temporary link
$document = Document::find(1);
$link = $document->createTemporaryLink();

// Get the URL
$url = $link->getUrl();
```

### Link Options

[](#link-options)

```
// Create a link that expires in 1 hour
$link = $document->createExpiringTemporaryLink(60);

// Create a single-use link
$link = $document->createSingleUseTemporaryLink();

// Create a link with IP restriction
$link = $document->createTemporaryLink([
    'restrict_ip' => $request->ip()
]);

// Create a link with device restriction
$link = $document->createTemporaryLink([
    'restrict_device' => true
]);

// Create a link with custom path
$link = $document->createTemporaryLinkForPath('/downloads/secret-file.pdf');
```

### Handling Access

[](#handling-access)

By default, accessing a link will redirect to the model or path. You can customize this behavior by adding a `handleTemporaryAccess` method to your model:

```
public function handleTemporaryAccess($link, $request)
{
    // Custom access logic here
    return Storage::download($this->file_path);
}
```

### Webhook Integration

[](#webhook-integration)

Configure webhooks in the config file to receive notifications when links are accessed or expire.

Configuration
-------------

[](#configuration)

See the `config/temporary-links.php` file for all configuration options.

License
-------

[](#license)

The MIT License (MIT). Please see License File for more information.

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance42

Moderate activity, may be stable

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity43

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

Unknown

Total

1

Last Release

482d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/31973079?v=4)[Shahadh](/maintainers/Shahadh7)[@Shahadh7](https://github.com/Shahadh7)

---

Top Contributors

[![Shahadh7](https://avatars.githubusercontent.com/u/31973079?v=4)](https://github.com/Shahadh7 "Shahadh7 (2 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/shahadh-laravel-temporary-links/health.svg)

```
[![Health](https://phpackages.com/badges/shahadh-laravel-temporary-links/health.svg)](https://phpackages.com/packages/shahadh-laravel-temporary-links)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[yajra/laravel-oci8

Oracle DB driver for Laravel via OCI8

8793.2M25](/packages/yajra-laravel-oci8)[mike-bronner/laravel-model-caching

Automatic caching for Eloquent models.

2.4k91.9k1](/packages/mike-bronner-laravel-model-caching)[api-platform/laravel

API Platform support for Laravel

58171.6k14](/packages/api-platform-laravel)[hasinhayder/tyro

Tyro - The ultimate Authentication, Authorization, and Role &amp; Privilege Management solution for Laravel 12 &amp; 13

6804.7k6](/packages/hasinhayder-tyro)[pressbooks/pressbooks

Pressbooks is an open source book publishing tool built on a WordPress multisite platform. Pressbooks outputs books in multiple formats, including PDF, EPUB, web, and a variety of XML flavours, using a theming/templating system, driven by CSS.

45444.2k1](/packages/pressbooks-pressbooks)

PHPackages © 2026

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