aimeos/map
High-performance e-commerce framework for Laravel/Lumen (and other PHP apps). Provides products, catalog, basket, checkout, customers, orders and admin UI. Extensible via plugins, supports multiple shops/sites, currencies and languages, and scales well.
Start by installing via Composer:
composer require aimeos/map
The package provides a fluent, immutable Map class that extends ArrayObject for easy array manipulation. Your first use case: transforming data. Instead of nested array_map() and array_filter() calls, chain methods:
use Aimeos\Map\Map;
$users = new Map([
['id' => 1, 'name' => 'Alice', 'active' => true],
['id' => 2, 'name' => 'Bob', 'active' => false],
]);
$result = $users
->filter(fn($u) => $u['active'])
->map(fn($u) => $u['name'])
->toArray(); // ['Alice']
Check the examples/ directory in the repo for quick starter snippets—though the package is lightweight, it lacks extensive official docs.
map(), filter()) return a new Map instance. Use ->apply() to mutate in-place when safe (e.g., internal state).toArray(), toJson(), or iteration. Ideal for API responses or data pipelines:
$pipeline = (new Map($largeDataset))
->filter expensiveFilter()
->map expensiveTransform()
->sort();
$output = $pipeline->toArray(); // triggers processing
new Map([1, 2, 3])->keyBy(fn($v) => "item_{$v}");
->map() → Map::fromArray($laravelCollection->all()).map() preserves numeric keys by default. Use ->keyBy(fn($v) => $v['id']) if keys must reset.count() or toArray() calls inside loops—cache the Map instance.map() doesn’t recurse into nested arrays. For deep transforms, use custom recursion or forEachDeep() (if available in newer versions).print_r() on a Map shows internal ArrayObject structure. Use ->debug() (if added) or cast to array: (array)$map.Map to add domain-specific methods (e.g., validate(), toDto()) without breaking immutability:
class UserMap extends Map {
public function active(): self {
return $this->filter(fn($u) => $u['active']);
}
}
How can I help you explore Laravel packages today?