Download the PHP package fsasvari/laravel-uploadify without Composer
On this page you can find all versions of the php package fsasvari/laravel-uploadify. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package laravel-uploadify
Laravel Uploadify
Uploadify is a library for Laravel 5.5+ that handles image uploading with automatic renaming, showing thumbnail image with custom routes and more. All that is available over Eloquent models.
Installation
Step 1: Install package
To get started with Laravel Uploadify, execute Composer command to add the package to your composer.json project's dependencies:
Or add it directly by copying next line into composer.json:
And then run composer update:
Step 2: Service Provider and Facade
After installing the Laravel Uploadify library, register the Uploadify\Providers\UploadifyServiceProvider
in your config/app.php
configuration file:
Optionally, you can add alias to Uploadify
facade:
Step 3: Configuration
We need copy the configuration file to our project.
Step 4: Symbolic link
If you have not yet created symbolic link in project, we need to create link between public
and storage
directories. We can use built in Laravel function storage:link
which will create link between public/storage
and storage/app/storage
directories.
Or use Windows function for custom storage link:
Or use Unix function for custom storage link:
Step 5: Models
You need to include UploadifyTrait
trait in your Eloquent models.
Files
If you need to show simple files (pdf, doc, zip...) in Eloquent model, you need to define $uploadifyFiles
public property with database field name as key and path
as array value which is required. Also, disk
value is optional and it will be taken from default disk value from configuration.
Images
If you need to show images (jpg, png, gif...) in Eloquent model, you need to define $uploadifyImages
public property with database field name as key and path
as array value which is required. Also, disk
value is optional and it will be taken from default disk value from configuration.
Files and Images combined
You can also combine files and images into one Eloquent model:
Step 6: Router
If you want to show processed images, you will need to include Uploadify controller in routes/web.php
file.
Usage
Files
Images
List of options
List of custom options you can use when calling url() method:
- width
- height
- crop:
fit
(default),resize
- effect:
greyscale
,invert
- quality:
0
-100
(90
is default value) - blur:
0
-100
- brightness:
-100
-100
- contrast:
-100
-100
- sharpen:
0
-100
- pixelate: (size of pixels)
- rotate:
-360
-360
- flip:
h
(horizontal),v
(vertical)
Upload with UploadedFile
Upload example with usage of Laravel UploadedFile class received by Request instance.
Upload from path or url
Upload example with usage of file received from path
or url
.
Upload with InterventionImage
Upload example with usage of Intervention Image class created by user. First, you create Image instance with all image manipulations you want (resize, crop, rotate, grayscale...) and then inject that image instance in UploadifyManager.
Delete
delete() method deletes file from filesystem
Example Usage
Controller
View
Licence
MIT Licence. Refer to the LICENSE file to get more info.
Author
Frano Šašvari
Email: [email protected]
All versions of laravel-uploadify with dependencies
illuminate/http Version 5.5.*|5.6.*|5.7.*|5.8.*|6.*|7.*|8.*
illuminate/filesystem Version 5.5.*|5.6.*|5.7.*|5.8.*|6.*|7.*|8.*
intervention/image Version 2.4.*|2.5.*|2.6.*|2.7.*