Download the PHP package abianbiya/filehandler without Composer

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

Abianbiya/Filehandler

Latest Version on Packagist Total Downloads Build Status

Simple package for handling upload file and versioning to local disk or AWS S3.

Installation

Via Composer

Usage

Main todo

  1. Make your model (that gonna have attached file into it) implements HasFile and use InteractsWithFile trait
  2. That's it.

Configure the default disk

  1. Set FILESYSTEM_DISK env variable (local or s3)
  2. Fill the configuration detail if you use s3

Storing file

Storing uploaded file from request

  1. Set your request validation
  2. Catch the file field by calling the model and then save it

    • fieldname is the form name
    • foldername is.. you know, the kind of file or whatever that categories the file into some sh*t (actually this will be used as the folder name in the storage)

Storing file from path

Setting file properties

Set some properties to the model's attached file with this function right before ->addFileFrom{What} called.

Retrieving the file

Access the file with adding the file or files eager loading ORM relation to you model. file function stands for the single attached file and files for multiple files.

this relation return MediaFile object instance so you can filter it using collection for multiple files or do some operation such as:

then load the assets

additional option for wrapping file upload form with drag-and-drop input

then use class .dropify

Intercepting File Access (using masked URL)

The default access to the file is true, otherwise you would like to add a gate to the masked URL route, add this method into your implemented InteractsWithFile model:

Change log

Please see the changelog for more information on what has changed recently.

Testing

Contributing

Please see contributing.md for details and a todolist.

Security

If you discover any security related issues, please poke me at @abianbiya (wherever) instead of using the issue tracker.

Credits

License

MIT. Please see the license file for more information.


All versions of filehandler with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0|^8.1|^8.2|^8.3
laravel/framework Version ^9.0|^10.0|^11.0|^12.0
league/flysystem-aws-s3-v3 Version ^3.0
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 abianbiya/filehandler contains the following files

Loading the files please wait ....