Download the PHP package rezaf-dev/laravel-temp-link without Composer
On this page you can find all versions of the php package rezaf-dev/laravel-temp-link. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download rezaf-dev/laravel-temp-link
More information about rezaf-dev/laravel-temp-link
Files in rezaf-dev/laravel-temp-link
Package laravel-temp-link
Short Description Generate temporary symlinks to private files without using any database
License MIT
Informations about the package laravel-temp-link
Laravel Temporary Link
If you have a private file and want to give access to it for a short period, this package helps you create a temporary link to this file. It doesn't need a database and works just by symlinks. Users can directly access a private file with a direct link that is randomly generated. A scheduled task will delete expired links.
Installation
You can install the package via composer:
You can publish the config file with:
This is the contents of the published config file:
Usage
You can use TempLink Facade to generate a new link:
You need to set laravel scheduler to run regularly to remove expired links. Please note that if you run a cron job every 10 minutes, you shouldn't generate links with an expiration time less than 10 minutes (You can, but it doesn't work).
You can also run this command manually to remove the expired links:
If you want to schedule this command yourself, you can set "scheduler" config to false.
To make the deletion more efficient, you should not generate links with less than 100 seconds expiration time.
Testing
Changelog
Please see CHANGELOG for more information on what has changed recently.
License
The MIT License (MIT). Please see License File for more information.