Download the PHP package hesham14yahia/image-full-control without Composer
On this page you can find all versions of the php package hesham14yahia/image-full-control. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download hesham14yahia/image-full-control
More information about hesham14yahia/image-full-control
Files in hesham14yahia/image-full-control
Package image-full-control
Short Description Laravel package gives you full control of uploading, managing and manipulating app images.
License MIT
Informations about the package image-full-control
Image Full Control
Laravel package gives you full control of uploading, managing and manipulating app images.
Requirements
- PHP >=5.4
- Fileinfo Extension
Supported Image Libraries
- GD Library (>=2.0)
- Imagick PHP extension (>=6.5.7)
- Intervention Image
Create files and folders
In laravel public folder create uploads folder and then create a folder for whatever type of image you will upload, let's named for example users, and add to it .gitignore file with
to prevent images to upload to git.
Install Package
How to use it "uploading"
Just add
in your controller, then call static method uploadImage()
just only two required parameters, first one the submitted image from the form, and the second one is the folder name, if you used in your method Independy Injection "Request" with the input file name "image" and folder name "users", it will be like that.
the method returns the uploaded image name.
More options "managing"
You can update image field with it, by adding the third parameter, which is an old image name, if we stick with the user example, and you created an instance of the user model, it will be like that.
the method returns the new uploaded image name and deletes the old one, if you don't want to delete the old image, just don't pass it.
You can also "manipulating"
Determine image width or height or even quality, all this is optional, but they have an order you should stick with it, so if you will use all, it will be like that.
it will make the image with width 50px and height 100px and quality 75%, if you want to use only quality for example, it will be like that.
Note: default quilty is 100%.
Image Full Path
To make handling images easier, start from version 1.3.0
we add method returns image full path accepts folder name and image name, it will be like that.