PHPackages                             dot-env-it/collage - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Image &amp; Media](/categories/media)
4. /
5. dot-env-it/collage

ActiveLibrary[Image &amp; Media](/categories/media)

dot-env-it/collage
==================

An adaptive, memory-safe image collage generator for Laravel.

v2.0.1(1w ago)0261↓54%MITPHPPHP ^8.3CI passing

Since May 17Pushed 1w agoCompare

[ Source](https://github.com/dot-env-it/collage)[ Packagist](https://packagist.org/packages/dot-env-it/collage)[ Fund](https://www.buymeacoffee.com/jagdish.j.ptl)[ Fund](https://paypal.me/jagdishjptl)[ RSS](/packages/dot-env-it-collage/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (2)Dependencies (3)Versions (25)Used By (0)

Dot-Env-It Collage
==================

[](#dot-env-it-collage)

  ![Collage](https://camo.githubusercontent.com/93faff121f2120d11bed352d3b5b87281073c27b1d91c1362b8d8e4d5a9cd85b/68747470733a2f2f62616e6e6572732e6265796f6e64636f2e64652f436f6c6c6167652e706e673f7061747465726e3d746f706f677261706879267374796c653d7374796c655f3226666f6e7453697a653d3130307078266d643d312673686f7757617465726d61726b3d31267468656d653d6c69676874267061636b6167654d616e616765723d636f6d706f7365722b72657175697265267061636b6167654e616d653d646f742d656e762d6974253246636f6c6c616765266465736372697074696f6e3d416e2b61646170746976652532432b6d656d6f72792d736166652b696d6167652b636f6c6c6167652b67656e657261746f722b666f722b4c61726176656c2e26696d616765733d68747470732533412532462532467777772e7068702e6e6574253246696d616765732532466c6f676f732532466e65772d7068702d6c6f676f2e737667)[![Latest Stable Version](https://camo.githubusercontent.com/4b31998443ef58abd1af00fcb1bf50ac43363afa4f706fe5425f7f53167c2b27/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f646f742d656e762d69742f636f6c6c6167652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/dot-env-it/collage)[![Total Downloads](https://camo.githubusercontent.com/34f81529e5f841f640d68b3d64c273fc03de85958d91891f332409801b3d6880/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f646f742d656e762d69742f636f6c6c6167652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/dot-env-it/collage)[![License](https://camo.githubusercontent.com/c72fba0a2443445445f7e341848e847aafe286734ac3ae400b39fe2eccf8e930/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f646f742d656e762d69742f636f6c6c6167652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/dot-env-it/collage)

A dynamic, memory-safe image collage generator for Laravel. This package evaluates image orientations on the fly to produce structural, clean masonry grids (such as top-banners or side-portrait pillars) layouts.

Features
--------

[](#features)

- **Adaptive 3-Image Engine**: Intelligently swaps between a *Landscape Banner* framework or a *Portrait Left Pillar* layout depending on the primary image's aspect ratio.
- **Dynamic Height Compression**: Automatically calculates and shrinks row elements proportionally using a configuration threshold boundary (`canvas_height`) so multi-image elements snap perfectly onto single-page PDF engines (like DomPDF or Snappy) without creating blank whitespace gaps.
- **Memory Optimization Pipeline**: Gathers layout image dimensions safely (`getimagesize`) without loading pixel matrices directly into memory, cleaning up processing allocations instantly after write sequences finish to protect server thresholds.
- **Fluent Chaining Interface**: Allows developers to adjust constraints on the fly and immediately pluck out absolute filesystem paths or asset URLs.

---

Installation
------------

[](#installation)

You can install this package easily via Composer.

### 1. Run the Composer Require Command

[](#1-run-the-composer-require-command)

Execute the following command in your terminal root to download and install the distribution:

```
composer require dot-env-it/collage
```

### 2. Publish Configuration Assets

[](#2-publish-configuration-assets)

Expose the custom layout variables to your root application configuration directory by running:

```
php artisan vendor:publish --tag=collage-config
```

---

Configuration
-------------

[](#configuration)

Once published, you can fine-tune default compilation parameters globally inside `config/collage.php`:

```
return [
    // Default canvas width constraint (Pixels)
    'canvas_width' => 1200,

    // Strict maximum vertical height ceiling to prevent page-overflow breaks
    'canvas_height'  => 1200,

    // Border gaps between bounding layout rows/columns
    'padding'      => 12,

    // Default Storage Disk driver target
    'disk'         => 'public',
];
```

---

Usage
-----

[](#usage)

### Basic Usage

[](#basic-usage)

Pass an array of local absolute file paths to the Collage builder and export it to your destination path:

```
use DotEnvIt\Collage\Facades\Collage;

$imagePaths = [
    '/storage/app/public/photos/img1.jpg',
    '/storage/app/public/photos/img2.jpg',
    '/storage/app/public/photos/img3.jpg',
];

// Returns instance of Collage after writing to disk
$collage = Collage::make()
    ->from($imagePaths)
    ->save('collages/event-101.jpg');
```

### Fluent Extraction Methods

[](#fluent-extraction-methods)

You can easily extract the file targets inline directly out of your execution pipeline:

```
// Extract the absolute local file path (perfect for PDF engines)
$absolutePath = Collage::make()
    ->from($imagePaths)
    ->save('collages/event-101.jpg')
    ->getPath();
// Returns: "/home/user/app/storage/app/public/collages/event-101.jpg"

// Extract the publicly accessible public asset URL string
$publicUrl = Collage::make()
    ->from($imagePaths)
    ->save('collages/event-101.jpg')
    ->getUrl();
// Returns: "[https://your-domain.com/storage/collages/event-101.jpg](https://your-domain.com/storage/collages/event-101.jpg)"
```

### Runtime Method Overrides

[](#runtime-method-overrides)

If a specific layout demands unique structural parameters that differ from your global `config/collage.php` file defaults, you can override settings fluently at runtime:

```
$customCollagePath = Collage::make()
    ->from($imagePaths)
    ->width(1600)       // Enforce a crisp wider base profile
    ->height(1200)  // Expand vertical space threshold limit
    ->disk('local')
    ->save('collages/high-res-event.jpg')
    ->getPath();
```

---

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

48

—

FairBetter than 94% of packages

Maintenance98

Actively maintained with recent releases

Popularity17

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 80.4% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~7 days

Total

3

Last Release

9d ago

Major Versions

v1.0.0 → v2.0.02026-05-31

PHP version history (2 changes)v1.0.0PHP ^8.1

v2.0.1PHP ^8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/4e7c021b8f19406056e9a24ec8d268cec00f1a9d77bd72d8cc5cb0a6fbc6a178?d=identicon)[Jagdish-J-P](/maintainers/Jagdish-J-P)

---

Top Contributors

[![Jagdish-J-P](https://avatars.githubusercontent.com/u/20887370?v=4)](https://github.com/Jagdish-J-P "Jagdish-J-P (90 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (22 commits)")

### Embed Badge

![Health badge](/badges/dot-env-it-collage/health.svg)

```
[![Health](https://phpackages.com/badges/dot-env-it-collage/health.svg)](https://phpackages.com/packages/dot-env-it-collage)
```

###  Alternatives

[league/glide

Wonderfully easy on-demand image manipulation library with an HTTP based API.

2.8k52.6M137](/packages/league-glide)[intervention/image-laravel

Laravel Integration of Intervention Image

1558.1M158](/packages/intervention-image-laravel)[unopim/unopim

UnoPim Laravel PIM

10.1k2.2k](/packages/unopim-unopim)[bkwld/croppa

Image thumbnail creation through specially formatted URLs for Laravel

506511.0k27](/packages/bkwld-croppa)[intervention/image-driver-vips

libvips driver for Intervention Image

47144.1k10](/packages/intervention-image-driver-vips)[simonhamp/the-og

A minimalist OpenGraph Image Generator for PHP

29258.1k](/packages/simonhamp-the-og)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
