PHPackages                             cloudstek/php-laff - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. cloudstek/php-laff

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

cloudstek/php-laff
==================

Largest Area Fit First (LAFF) 3D box packing algorithm class for PHP

v1.1.1(6y ago)8779.5k↓40.8%32[5 issues](https://github.com/Cloudstek/php-laff/issues)MITPHP

Since Oct 13Pushed 6y ago12 watchersCompare

[ Source](https://github.com/Cloudstek/php-laff)[ Packagist](https://packagist.org/packages/cloudstek/php-laff)[ Docs](https://github.com/Cloudstek/php-laff)[ RSS](/packages/cloudstek-php-laff/feed)WikiDiscussions master Synced yesterday

READMEChangelog (4)DependenciesVersions (4)Used By (0)

Largest Area Fit First (LAFF) 3D box packing algorithm class for PHP
====================================================================

[](#largest-area-fit-first-laff-3d-box-packing-algorithm-class-for-php)

Introduction
------------

[](#introduction)

This PHP class helps to solve the so called "3D packing problem" often seen when packing containers with boxes (eg. for a webshop). It calculates the approximate minimum container size needed to fit the boxes and also gives additional information like on which level they are packed.

The class was written using the "An Efficient Algorithm for 3D Rectangular Box Packing" paper by M. Zahid Gürbüz, Selim Akyokus, Ibrahim Emiroglu and Aysun Güran. It contains a step by step explanation of the problem and the solution.

PDF file of the document:

Minimum Requirements
--------------------

[](#minimum-requirements)

- PHP 5+

### Installation

[](#installation)

1. Install with composer `composer require cloudstek/php-laff` or include the Packer.php file in your php code
2. Initialize the Packer class
3. Call the pack() method to start packing
4. Sit back, sip a beer and relax!

Example:

```
// Initialize boxes array
$boxes = array(
	array(
		'length' => 50,
		'width'  => 35,
		'height' => 23
	),
	array(
		'length' => 18,
		'width'  => 38,
		'height' => 16
	)
);

// Initialize Packer
$laff = new \Cloudstek\PhpLaff\Packer();
$laff->pack($boxes);

// or

$laff = new \Cloudstek\PhpLaff\Packer($boxes);
$laff->pack();
```

Please see the examples directory for more examples!

###  Health Score

41

—

FairBetter than 87% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity47

Moderate usage in the ecosystem

Community21

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~341 days

Total

2

Last Release

2479d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/23e10b480322cc8b974864e6178fde94149b8c8ca99a3e1d318f9e7463be5452?d=identicon)[cloudstek](/maintainers/cloudstek)

---

Top Contributors

[![mdeboer](https://avatars.githubusercontent.com/u/1171956?v=4)](https://github.com/mdeboer "mdeboer (5 commits)")[![Cosmologist](https://avatars.githubusercontent.com/u/966525?v=4)](https://github.com/Cosmologist "Cosmologist (2 commits)")[![emirajbbd](https://avatars.githubusercontent.com/u/63784?v=4)](https://github.com/emirajbbd "emirajbbd (2 commits)")[![cottton](https://avatars.githubusercontent.com/u/13582504?v=4)](https://github.com/cottton "cottton (1 commits)")[![XaviPortell](https://avatars.githubusercontent.com/u/18068221?v=4)](https://github.com/XaviPortell "XaviPortell (1 commits)")

### Embed Badge

![Health badge](/badges/cloudstek-php-laff/health.svg)

```
[![Health](https://phpackages.com/badges/cloudstek-php-laff/health.svg)](https://phpackages.com/packages/cloudstek-php-laff)
```

###  Alternatives

[jacobemerick/kmeans

k-means clustering implemented in PHP

126.4k](/packages/jacobemerick-kmeans)

PHPackages © 2026

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