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. shahadh/laravel-temporary-links

ActiveLibrary

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

Generate temporary, expiring access links for Laravel applications

v1.0.0(1y ago)045MITPHPPHP ^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 1mo ago

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

28

—

LowBetter than 54% of packages

Maintenance45

Moderate activity, may be stable

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity42

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

429d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/f3fed7b4529dfa32a79a563d878c038e2ff786d6a730af3b10d3d68b15839abc?d=identicon)[Shahadh7](/maintainers/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

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M687](/packages/barryvdh-laravel-ide-helper)[fumeapp/modeltyper

Generate TypeScript interfaces from Laravel Models

196277.9k](/packages/fumeapp-modeltyper)[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.

44643.1k1](/packages/pressbooks-pressbooks)[api-platform/laravel

API Platform support for Laravel

59126.4k6](/packages/api-platform-laravel)[dragon-code/migrate-db

Easy data transfer from one database to another

15717.4k](/packages/dragon-code-migrate-db)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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