PHPackages                             devnull-ir/laravel-downloader - 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. [File &amp; Storage](/categories/file-storage)
4. /
5. devnull-ir/laravel-downloader

AbandonedArchivedLibrary[File &amp; Storage](/categories/file-storage)

devnull-ir/laravel-downloader
=============================

description

1.2.2(3y ago)7141MITPHPPHP &gt;=8.1

Since Jul 11Pushed 3y ago1 watchersCompare

[ Source](https://github.com/DevNull-IR/laravel-downloader)[ Packagist](https://packagist.org/packages/devnull-ir/laravel-downloader)[ RSS](/packages/devnull-ir-laravel-downloader/feed)WikiDiscussions main Synced today

READMEChangelog (10)Dependencies (2)Versions (13)Used By (0)

Laravel Downloader Usage
========================

[](#laravel-downloader-usage)

Download as a token with a specific time for your users or as a public use but as a token and with a specific time

### ***It does not allow downloading by idm***

[](#it-does-not-allow-downloading-by-idm)

Supported Version
=================

[](#supported-version)

Package VersionPHP Version[1.2.2](https://github.com/DevNull-IR/laravel-downloader/releases/tag/1.2.2)[8.1](https://php.net)[1.2.1](https://github.com/DevNull-IR/laravel-downloader/releases/tag/1.2.1)[8.1](https://php.net)[1.2.0](https://github.com/DevNull-IR/laravel-downloader/releases/tag/1.2.0)[8.1](https://php.net)[1.1.0](https://github.com/DevNull-IR/laravel-downloader/releases/tag/1.1.0)[8.1](https://php.net)[1.0.7](https://github.com/DevNull-IR/laravel-downloader/releases/tag/1.0.7)[8.1](https://php.net)[1.0.6](https://github.com/DevNull-IR/laravel-downloader/releases/tag/1.0.6)[8.1](https://php.net)[1.0.5](https://github.com/DevNull-IR/laravel-downloader/releases/tag/1.0.5)[8.1](https://php.net)[1.0.4](https://github.com/DevNull-IR/laravel-downloader/releases/tag/1.0.4)[8.1](https://php.net)[1.0.3](https://github.com/DevNull-IR/laravel-downloader/releases/tag/1.0.3)[8.1](https://php.net)Installation
============

[](#installation)

whit composer: `composer require devnull-ir/laravel-downloader`

**If your Laravel version is higher than 8, there is no need to do this**

Added this Provider `\DevNullIr\LaravelDownloader\ServiceProvider\LaravelDownloaderServiceProvider::class` to `config/app.php`:

```
'providers' => [
    ...
    \DevNullIr\LaravelDownloader\ServiceProvider\LaravelDownloaderServiceProvider::class,
    ...
]
```

and added Facade to aliases `"LaravelDownloader" => \DevNullIr\LaravelDownloader\Facade\LaravelDownloaderFacade::class`: new Version Laravel:

```
    'aliases' => Facade::defaultAliases()->merge([
        ...
        "LaravelDownloader" => \DevNullIr\LaravelDownloader\Facade\LaravelDownloaderFacade::class
        ...
    ])->toArray(),
```

old version:

```
'aliases' => [
    ...
    "LaravelDownloader" => \DevNullIr\LaravelDownloader\Facade\LaravelDownloaderFacade::class,
    ...
];
```

Usage
=====

[](#usage)

Enter the following command in your terminal

```
php artisan migrate
```

If you are not offered codes, you should use the following facade:

```
use DevNullIr\LaravelDownloader\Facade\LaravelDownloaderFacade as LaravelDownloader;
```

If you want to upload a file, do the following:

Use in your controller:

```
use DevNullIr\LaravelDownloader\Facade\LaravelDownloaderFacade as LaravelDownloader;
use \Illuminate\Support\Facades\Request;
```

and change your function controller

```
public function upload(Request $request){
    LaravelDownloader::Upload("videoPros", $request->file('input'));
}
```

Now your file has been uploaded

Giving access to a file to the user
===================================

[](#giving-access-to-a-file-to-the-user)

Access to only one user

```
     LaravelDownloader::purchased(file_id, count);
```

The first parameter is the desired file and the second parameter is the number of downloads that a user can do

```
     LaravelDownloader::purchased(1, 5);
```

It is set for a user who is logged in, otherwise a file will not be registered for the user

**The default value of count is one**

helper function for this method:

`purchased(int $file_id, int $count = 1): bool`

```
purchased(1,1)
// file 1 With the number of downloads 1
```

**Publish the file publicly to everyone**

```
LaravelDownloader::GeneralPurchased($file_id);
```

```
LaravelDownloader::GeneralPurchased(1);

// file 1 Register All User (It is also available for users who have not logged in)
```

helper function for this method:

`GeneralPurchased(int $file_id): bool|int`

```
GeneralPurchased(1)
// file 1 Register All User (It is also available for users who have not logged in)
```

Register New Token
==================

[](#register-new-token)

If the user does not have a token, she cannot download, so creating a token for each download is very important

You have to register a token so that a user can start downloading with that token

`LaravelDownloader::registerToken($purchased_id);`

Each user has a purchase ID with which you can create a download token for her

The token you create here is for download and you must introduce it to your user and put it in the user's download link

```
LaravelDownloader::registerToken(1);
// You must enter the access ID that you gave to the user, and here the ID will be 1
```

helper function for this method:

`registerToken(int $purchased_id)`

register Token For all Users:

`registerTokenGeneral(int $purchased_id);`

Enter the file ID that is for all users, otherwise the token is not allowed

```
registerTokenGeneral(1);

// Enter the file ID that is for all users, otherwise the token is not allowed
```

Zip File
========

[](#zip-file)

After you have uploaded your file you can zip it

To zip, you need to do the following commands:

```
LaravelDownloader::zipArchive(array $config = [], array $files = []): array|bool|object
```

In the first parameter, you must enter the settings (as an array)

```
LaravelDownloader::zipArchive(['zipName'=>"NameFileZip"], array $files = []);
```

**Instead of NameFileZip, you must enter the name you want your zip file to have, otherwise the default value will be used.**

```
LaravelDownloader::zipArchive(['removed'=>true], array $files = []);
```

The default value is false, if you set this value to true, it will delete the files you zip

```
LaravelDownloader::zipArchive(['password'=>'domain'], array $files = []);
```

If you enable the ability to set a password for zip files, the password will be activated using this option.

By default, encryption is disabled for zip files. And also the default password is domain.com

***To activate the password function, you can read the configuration section***

Add file to my zip file
=======================

[](#add-file-to-my-zip-file)

```
LaravelDownloader::zipArchive(['password'=>'domain'],[8,9,10]);
```

In the second part, you can see the ID of each file

If the output is OK and the zip file is created, a new record will be registered in the database

Download File
=============

[](#download-file)

`LaravelDownloader::Download($DownloadToken);`

The token created in the previous step must be entered here

After validation, the download will start

helper function for this method:

`Download_ld(string $DownloadToken)`

***You must return the value to start the download***

You can use the following address for your downloads

`http://yourdomain/dl/{token}`

You can personalize this address as you will learn later

Create New Course
=================

[](#create-new-course)

### info

[](#info)

In version 1.1.0, we have provided a new feature for users to make their work easier and start selling their courses more easily.

Using this part and the next part, you can create a course and then check how many minutes this course is.

Starting
--------

[](#starting)

```
public static function makeCourse(string $CourseName, string $CoursePath): bool|object;
```

To create a new course, you need to give the name of that course and the directory address of that course

The directory you see is created automatically by the system itself, you don't need to create it

***This directory is located in storage/app/laravel-downloader***

**Be sure to enter the address you choose for the course in the first parameter when uploading**

```
LaravelDownloader::makeCourse("learn laravel downloader", "laravel-downloader-course")
```

The output is either `false` or an object from the `eloquent model`

Get Duration of all videos of a Course
======================================

[](#get-duration-of-all-videos-of-a-course)

```
public static function getDurationCourse(int $Course_ID): string|bool;
```

In the first parameter, you must enter the Course ID created in the previous step

The output is either a String or False

If the output value was false, it means that it did not find the course, and if it was String, it means that it has given you the duration of all the videos

If he is not logged in, he cannot read the article
==================================================

[](#if-he-is-not-logged-in-he-cannot-read-the-article)

For this, you only need to enter the content of your article as follows (Enter in the blade):

```
...
@ContinueAuth("Content Your Article (You can also write html here.)", "Pleas Logined And Continue (You can also write html here.)", "Parent tag classes of the desired text", "The desired text tag classes")
...
```

configuration
=============

[](#configuration)

run this command to terminal:

`php artisan vendor:publish --tag="LaravelDownloaderConfig"`

Now enter the config folder and open the LaravelDownloader.php file

To change the default address of downloads from this file, find the key "download\_route" in the returned array and change the value inside it to whatever you want. Now the default download links have changed.

```
return [
    ...
    'download_route' => "dl",
    ...
];
```

The special name of this route is "laravelDownloaderDl".

**Do you want to disable the default route?**
=============================================

[](#do-you-want-to-disable-the-default-route)

To disable the default route completely, change the value of the "showDownloadRoute" key to false

```
return [
    ...
    'showDownloadRoute' => true,
    ...
];
```

If `showView` is true, route `endDl` is activated

sample route:

`127.0.0.1:8000/endDl/Token`

This route creates a route that you can show a thank you message to the user.

For example, thank you for downloading from our site, there are many examples all over the internet.

You can customize the appearance that is shown to the user, which I will tell you later.

### change route tnx dl

[](#change-route-tnx-dl)

To change the name of that route, you can put whatever you want in the thank\_route part of the config file and it will change

### change view tnx dl route

[](#change-view-tnx-dl-route)

To customize the endDl output, you must enter the following command in the command line.

```
php artisan vendor:publish --tag="laravel-downloader-views"
```

Now it is saved in the path below the desired view

[![resources/views/vendor/laravelDownloader/download.blade.php](https://raw.githubusercontent.com/DevNull-IR/laravel-downloader/main/others/cap-1.PNG)](https://raw.githubusercontent.com/DevNull-IR/laravel-downloader/main/others/cap-1.PNG)

`resources/views/vendor/laravelDownloader/download.blade.php`

Passwords in zip file
=====================

[](#passwords-in-zip-file)

To activate this feature, it is necessary to set the "PassFile" value to true in the LaravelDownloader.php file in the config directory.

You can also change the filePassword value to change the default password

Models
======

[](#models)

Course Model namespace:`DevNullIr\LaravelDownloader\Database\Models\Course`

File List Model namespace:`DevNullIr\LaravelDownloader\Database\Models\File_dl`

Permissions files Model namespace:`DevNullIr\LaravelDownloader\Database\Models\Permissions_file`

purchased's Model namespace:`DevNullIr\LaravelDownloader\Database\Models\purchased`

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity64

Established project with proven stability

 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

Every ~1 days

Total

12

Last Release

1441d ago

PHP version history (3 changes)1.0.0PHP &gt;=7.4

1.0.1PHP &gt;=8.0

1.0.2PHP &gt;=8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/4e93cbe8942b4c92785450feb0da9e7e2a7346b9f8e7810379d59af3250200e6?d=identicon)[devnull-ir](/maintainers/devnull-ir)

---

Top Contributors

[![DevNull-IR](https://avatars.githubusercontent.com/u/97373457?v=4)](https://github.com/DevNull-IR "DevNull-IR (40 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/devnull-ir-laravel-downloader/health.svg)

```
[![Health](https://phpackages.com/badges/devnull-ir-laravel-downloader/health.svg)](https://phpackages.com/packages/devnull-ir-laravel-downloader)
```

###  Alternatives

[unisharp/laravel-filemanager

A file upload/editor intended for use with Laravel 5 to 10 and CKEditor / TinyMCE

2.2k3.5M85](/packages/unisharp-laravel-filemanager)[illuminate/filesystem

The Illuminate Filesystem package.

16165.0M3.1k](/packages/illuminate-filesystem)[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)

PHPackages © 2026

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