edalzell / download
Allow download of private assets by logged in users
v2.0.0-beta
2021-09-20 23:41 UTC
Requires
- php: ^8.0
- laravel/framework: ^8.61
- statamic/cms: ^3.2
Requires (Dev)
- mockery/mockery: ^1.3.1
- nunomaduro/collision: ^5.0
- orchestra/testbench: ^6.0
- phpunit/phpunit: ^9.0
This package is auto-updated.
Last update: 2024-12-21 06:38:18 UTC
README
This package provides a way to allow logged in users to download private assets.
Requirements
- PHP 8.0+
- Statamic v3.2+
Installation
You can install this package via composer using:
composer require edalzell/download
The package will automatically register itself.
NOTE: assets must be private (otherwise they are publicly accessible and can always be downloaded)
Usage
The {{ download }}
tag produces a url that will only allow the file to be downloaded if the user is logged in.
If someone not logged in tries the link, there will be an error returned in the errors
session key.
Parameters:
file
(required) - name of the filecontainer
(required) - container the file is in.