Download the PHP package abdelrahmanbl/laravel-uploadable without Composer

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

laravel-uploadable

Laravel Uploadable for adding behaviour to a model for self uploading file like avatar or any file type.

Introduction

This package can help you to upload image or any type of file to a specific destination in your filesystem, you can determine a path for a directory to save your uploaded file for each field in your table with minimal configurations or you can use the default store directory of the package.

Installation

About Upload

This package uses the Laravel File Storage to keep the file management. The file will be stored inside the default disk. For example, if you are using the public disk, to access the image or file, you need to create a symbolic link inside your project:

And then, configure your default filesystem from .env file

You can add default_url to the filesystems config file to overwrite the default file url. The default file url is asset('uploadable.jpg').

Usage

To use this package, import the FileCast in your model And then configure the $casts of your model with the FileCast class.

Customize The Directory

Customize The Disk

Customize The Driver

Note: your customer driver service must implement Bl\LaravelUploadable\Interfaces\UploadFileInterface and has a constructor with parameter $disk

Customize The Default Path

That's all! After this configuration, you can send file data from the client side with the same name of each file field of the model. The package will make the magic!

Example

In frontend you can create a form-data with field name avatar.

In backend you can pass all the data to the User model.

You can update the file manually to the User model.

Note: when update a field with a file the package will automatic delete the old file and put the new one.

Delete The File

You can use the FileCastRemover trait in your model and when you deleting the model instance all the related files will be deleted automatically.

And once the model instance is deleted all it's related files will be removed.

Apply The Events

You can apply events either before or after the file upload. In addition to, you can apply that globally or for custom field.

Global Events

Custom Events

For apply custom events you should create a service that implement Bl\LaravelUploadable\Interfaces\EventUploadInterface and path it as a parameter.

Note: when applying global and custom events in your model the priority go to the custom event.

Contributing

Feel free to comment, open issues and send PR's. Enjoy it!!

License

The MIT License (MIT). Please see License File for more information.


All versions of laravel-uploadable with dependencies

PHP Build Version
Package Version
No informations.
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 abdelrahmanbl/laravel-uploadable contains the following files

Loading the files please wait ....