Download the PHP package devnull-ir/laravel-downloader without Composer

On this page you can find all versions of the php package devnull-ir/laravel-downloader. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-downloader

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

Supported Version

Package Version PHP Version
1.2.2 8.1
1.2.1 8.1
1.2.0 8.1
1.1.0 8.1
1.0.7 8.1
1.0.6 8.1
1.0.5 8.1
1.0.4 8.1
1.0.3 8.1

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:

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

old version:

Usage

Enter the following command in your terminal

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

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

Use in your controller:

and change your function controller

Now your file has been uploaded

Giving access to a file to the user

Access to only one user

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

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

Publish the file publicly to everyone

helper function for this method:

GeneralPurchased(int $file_id): bool|int

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

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

Zip File

After you have uploaded your file you can zip it

To zip, you need to do the following commands:

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

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

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

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

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

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

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

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

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

Get Duration of all videos of a Course

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

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

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.

The special name of this route is "laravelDownloaderDl".

Do you want to disable the default route?

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

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

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

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

Now it is saved in the path below the desired view

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

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

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

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


All versions of laravel-downloader with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
illuminate/support Version >=5.7.19
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package devnull-ir/laravel-downloader contains the following files

Loading the files please wait ....