Download the PHP package kingofcode/laravel-uploadable without Composer

On this page you can find all versions of the php package kingofcode/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 trait to automatically upload images and files with minimum configuration.

Introduction

This package can help you to easily make uploads, using only one field in the database, and some simple attributes in your model class. With the default configuration, the package makes thumb, medium and normal image uploads. It can be used for other files upload too, like PDF, etc.

Installation

This package includes Intervention Image to resize and manage the images.

For Laravel version less than 5.8.10, please use 0.1.7 version, as 0.1.8 added model replication that is supported only for Laravel > 5.8.10

About Upload

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

And then, configure your default filesystem, inside config/filesystems.php to point the public disk:

Usage

To use this package, import the Uploadable trait in your model:

And then, configure your uploadable fields for images and files inside your model.

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!

Change Image Upload Size

The default sizes (width) for images are:

You can modify these values directly in the $uploadableImages array. The accepted values are: image_width or a number specifying the quantity of pixels.

Change Image Upload Types

By default, this package saves thumb, medium and normal images. To disable some upload type, add this array to your model:

Setting the upload folder name

The upload will be made inside a specific folder with the name of the model, but in the plural mode. Eg: for the Product model, the images will be uploaded to the 'images/products' directory, and the other files, inside 'files/products'. If you want to modify this directory, add this code to your model:

Getting the File Path inside Views, etc

To get an image file path, you can call getImagePath($imageField, $type) from your object. Eg:

And to get a simple file path, call getFilePath($fileField):

Inspiration

The basic structure of this package is inspired in the Laravel Auto Upload package

Contributing

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

License

MIT


All versions of laravel-uploadable with dependencies

PHP Build Version
Package Version
Requires intervention/image Version ^2.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 kingofcode/laravel-uploadable contains the following files

Loading the files please wait ....