Download the PHP package unisharp/laravel-fileapi without Composer

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

Laravel File API

Features

Installation

  1. Install File API

  2. Set service provider in config/app.php

  3. publish config file

Config

in config/fileapi.php

  1. fill in the storage path, which make routes for you.

    it will generate routes like below :

  2. set default thumb sizes(by key and value)

  3. set default image compress quality

  4. choose whether you want to enable upload directly by url(api)

    and upload to url by below

  5. and you might also want to set some middlewares to protect the upload route

Usage

Initialize File API

Save By Giving Uploaded File

Thumbnail functions

Get image url

Delete image and thumbs

Get file fullpath (abstract path from Laravel Storage)

Parse File Path to URL

if you store your file into cloud storage and you want to get url cloud site, you can use url() method to get it

Work with Laravel Storage

Auto Upload

if enable_api_upload=true in config/fileapi.php, you can upload file to these two path

  1. Image

    • head

       POST /api/v1/images/{target}/{param?}
    • body

       image={file multipart body}
  2. Video

    • head

      /api/v1/videos/{target}/{param?}
    • body

      video={file multipar body}

After uploaded

you add event listener to finish up after file uploaded, file api will fire image.{target}.created and video.{target}.created

Step

  1. Write listener under App\Listeners

    <?php
    
    namespace App\Listeners;
    
    class ArticleImageListener
    {
    
         public function handle($param, $filename, $path)
        {
            ... do something ...
        }
    }
  2. Write event mapping in Providers\EvnetService\Providers

        protected $listen = [
            'image.article.created' => [
                'App\Listeners\ArticleImageListener'
            ],
        ];

Configurations

'enable_api_upload' => false, // auto upload api
'api_prefix' => '/api/v1',    // upload api url prefix
'middlewares' => [],          // middlewares that wrap the api upload route

All versions of laravel-fileapi with dependencies

PHP Build Version
Package Version
Requires php Version >=5.5.0
illuminate/support Version >=5.0.0
league/flysystem Version >=1.0
symfony/http-foundation Version >=2.0
ext-gd Version *
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 unisharp/laravel-fileapi contains the following files

Loading the files please wait ....