Download the PHP package bkstar123/laravel-uploader without Composer

On this page you can find all versions of the php package bkstar123/laravel-uploader. 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-uploader

laravel-uploader

Provide a Laravel backend for handling file upload

1.Requirements

It is recommended to install this package with PHP version 7.1.3+ and Laravel Framework version 5.5+

2.Installation

composer require bkstar123/laravel-uploader

You can upload files to the backend either via a normal form submit or via AJAX calls (built by yourself or any third party plugins).

Note:

3.Usage

3.1 In Controller

Firstly, you typehint in a controller constructor to inject a FileUpload service.

Then, in the method which is supposed to handle a file upload request, you call

Where:

$uploadSettings is an asociative array with the following possible keys:

The backend default settings are as follows:

You can change these default settings by using the following environment variables in .env:

Note: The inline settings will overwrite the default ones

If the upload succeeds, will return the following data for being further persisted to database:

If the uploaded file is not valid, then will be returned and an error message will be set for

3.2 In frontend view

3.2.1 Normal form upload

(Only support single file upload)

Example:

3.2.2 AJAX uploading using default frontend assets from Krajee

(Support sending multiple files in parallel requests)

Example:

Note: When using Krajee fileinput plugin, you must return a json response from the controller method which handles the upload request as follows:

3.2.3 AJAX uploading using @bkstar18/jquery-ajax-uploader plugin (written by myself)

You can check its full documentation at https://github.com/bkstar123/jquery-ajax-uploader

Example use:

a) Installation

Then, include in any view where you want to use the plugin. Remember to load JQuery before using the plugin.

b) In HTML section

c) In Javascript section

d) In Laravel Controller method

Note:
You should make sure that the page html layout has the following tag:

Otherwise, the request may be blocked by Laravel by default. See more details at https://laravel.com/docs/5.8/csrf#csrf-x-csrf-token.

The plugin automatically checks the existence of this tag, get its content and associate header with the uploading request.

Alternatively, if and only if this tag does not exist (maybe you do not want to use, or for somewhat reasons), then you can include request header before sending files to server via hook as follows:

3.2.4 AJAX uploading using @bkstar18/vue-ajax-uploader plugin (written by myself)

Check https://github.com/bkstar123/vue-ajax-uploader for details.

3.3 Physically remove an uploaded file

You can physically delete an uploaded file as in following example:

In this example, the photos table must have and columns to persist a instance.

You should physically remove an uploaded file only after deleting its relevant record in the database.


All versions of laravel-uploader with dependencies

PHP Build Version
Package Version
Requires php Version ^7.1.3
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 bkstar123/laravel-uploader contains the following files

Loading the files please wait ....