Download the PHP package tzsk/collage without Composer
On this page you can find all versions of the php package tzsk/collage. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Package collage
Short Description Generate Image Collage with Laravel
License MIT
Homepage https://github.com/tzsk/collage
Informations about the package collage
:gift: PHP Collage Maker
Create Image Collage with ease now with PHP. This package uses intervention/image
package to leverage image manipulation.
Using this package is very easy and creating Beautiful Collages are not tough anymore.
NOTE: Currently this package only supports 4 images. You can write your own generator to add 5 if you like.
:package: Installation
This is a composer package. So just run the below composer command inside your project directory to get it installed.
:gear: Configure
If you are using this package outside laravel then you don't need to do this step.
config/app.php
This package supports Package Auto-Discovery. And the latest version only supports Laravel >= 7.x
If you want to use any other driver besides 'gd'
then you have to publish the configuration file:
You will then have a file in your config directory: config/collage.php
If you are using 'imagick'
then you can change it.
:fire: Usage
First you need to have a set of images to make collage of. This package can except many kinds of Targets.
There are other kinds of image targets supported:
Depending upon the number of images in the array this package will automatically use the right Generator.
:globe_with_meridians: Examples Outside Laravel
Firstly, use the Class Namespace at the top.
The Driver is either 'gd' or 'imagick'. Depending upon which library you are using with PHP. You can customize that. The default is
'gd'
.
Create collage with 1 Image
Supported, yes.
Create collage with 2 images
You can also add
padding()
andbackground()
here.
Create collage with 3 images
You can also add
padding()
andbackground()
here.
Create collage with 4 images
You can also add
padding()
andbackground()
here.
:heart_eyes: Examples in Laravel
In laravel you already have the Alias for the Collage Maker
The rest of the Features are same as when using in normal php.
Create collage with 1 Image
Create collage with 2 images
You can also add
padding()
andbackground()
here.
Create collage with 3 images
You can also add
padding()
andbackground()
here.
Create collage with 4 images
You can also add
padding()
andbackground()
here.
:trophy: Return Value
The reaturned $image
is the instance of Intervention\Image\Image
object.
You can do multiple things with it.
- You can save the final collage.
- You can just use it as a plain response.
- You can crop/resize/colorize and more.
Read more about what you can do in the Official Documentation.
:electric_plug: Create Custom Generators
Creating a generator is very easy. Create a class that extends the abstract class: Tzsk\Collage\Contracts\CollageGenerator
.
Example:
NOTE: Take a look at
src/Contracts/CollageGenerator.php
for details about all the things you have access to in the generator class. Also, if you need a reference consider looking into:src/Generators/FourImage.php
.
Extend outside laravel
You can also override existing generators. Let's say you want to have the FourImage generator to behave differently.
You can make your own MyFourImage
class and add it.
Extend in laravel
You can also override existing generators. Let's say you want to have the FourImage generator to behave differently.
You can make your own MyFourImage
class and add it.
You can also do this from the config/collage.php
config file.
There is a generators
array which is currently empty. You can add your own generators there like below to Replace or add new generators.
:microscope: Testing
:date: Changelog
Please see CHANGELOG for more information on what has changed recently.
:heart: Contributing
Please see CONTRIBUTING for details.
:lock: Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
:crown: Credits
- Kazi Ahmed
- All Contributors
:policeman: License
The MIT License (MIT). Please see License File for more information.
All versions of collage with dependencies
illuminate/support Version ^8.0|^9.0|^10.0
intervention/image Version ^2.5
laravel/pint Version ^1.10