tahaazare/secure-download

Generate secure download links with expiration in Laravel

Installs: 6

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 0

Open Issues: 0

pkg:composer/tahaazare/secure-download

v1.0.1 2025-07-14 17:13 UTC

This package is auto-updated.

Last update: 2025-12-15 05:58:46 UTC


README

📖 Introduction | معرفی

این پکیج به شما کمک می‌کند تا برای فایل‌های خود لینک دانلود امن و موقت تولید کنید.
به‌طوری‌که لینک فقط برای مدت مشخصی معتبر باشد (مثلاً ۳۰ ثانیه، ۵ دقیقه یا ۲ ساعت)
و فقط برای یک مسیر مشخص قابل استفاده باشد. همچنین برای اینکه محدودیت تعداد دانلود و اطلاعات لینک‌ها به درستی ذخیره شود،
باید پس از نصب پکیج دستور migrate را اجرا کنید تا جدول‌های لازم در دیتابیس ساخته شود.

This package helps you generate secure, temporary download links for your files in Laravel. Each link is valid for a specific time (e.g., 30 seconds, 5 minutes, or 2 hours) and is only usable for the given file path.

To track download limits and link information, you must run database migrations after installation to create the necessary table

📦 نصب | Installation

1. Install the Package

Run the following command in your Laravel project terminal:

composer require tahaazare/secure-download

2. Publish the Configuration File (Optional but Recommended)

php artisan vendor:publish --provider="Tahaazare\SecureDownload\SecureDownloadServiceProvider"

The config file will be located at

config/secure-download.php

3. Migration

php artisan migrate

🛠 Generate Secure Download Link | ساخت لینک دانلود امن (Quick Usage)

$link = SecureDownload::generate(
    'files/report.pdf',
    30,
    TimeUnitEnum::Seconds,
    FileTypeEnum::Storage,
    null, //int | max_downloads 
);