akeneo/measure-bundle is a niche but well-defined solution for unit conversion (e.g., length, weight, temperature) with extensibility for custom families (e.g., capacitance, pressure). It fits systems requiring structured, rule-based conversions (e.g., e-commerce, scientific apps, logistics).symfony/console or symfony/dependency-injection). For Laravel, integration would need:
symfony/dependency-injection + symfony/http-kernel).ServiceProvider or manual container binding.config/measure.php) or a database table for dynamic units.mul/div).symfony/console).symfony/dependency-injection with Laravel’s container).spatie/array-to-object, php-ai/php-calculator (for dynamic formulas).unitsofmeasurement/uom (PHP library, no Symfony).laravel/symfony-bridge). For vanilla Laravel:
$app->bind()).config/measure.php or a database table (e.g., measure_units).POST /api/convert).measure_families, measure_units, and measure_conversion_rules tables.UnitUpdated) to refresh the converter’s config.Redis) or precompute conversion matrices for performance.MeasureServiceProvider to:
config/measure.php or database.// app/Providers/MeasureServiceProvider.php
public function register()
{
$this->app->singleton('measure.converter', function ($app) {
$config = config('measure.units');
return new \Akeneo\Bundle\MeasureBundle\Convert\MeasureConverter($config);
});
}
MeasureUnit model and hydrate the converter’s config on boot.$config = MeasureUnit::query()
->with('family')
->get()
->groupBy('family.name')
->toArray();
| Component | Compatibility | Workaround |
|---|---|---|
| Symfony DI | ❌ No native Laravel support | Use symfony/dependency-injection + container binding |
| YAML Config | ❌ Laravel prefers PHP/JSON | Convert to config/measure.php or database |
| PHP 5.3+ | ❌ Laravel 9+ requires PHP 8.0+ | Fork or use polyfills |
| Akeneo PIM Interfaces | ❌ Tight coupling to Akeneo’s interfaces (e.g., LengthFamilyInterface) |
Extend or replace with custom interfaces |
| CLI Tools | ❌ Travis/PHPSpec not needed in Laravel | Replace with Laravel’s testing tools |
config/measure.php.Problem or custom responses.How can I help you explore Laravel packages today?