GeodisBundle is a Symfony bundle for generating and managing Geodis shipping labels.
It provides a simple and efficient integration of the Geodis API into Symfony projects.
- ✅ Full compatibility with modern Symfony versions
- ✅ Improved service configuration with
autowire&autoconfiguresupport - ✅ Cleaner error handling with a new
ExceptionListener - ✅ Lazy-loading for the
GeodisJsonApiservice - ✅ Refactored code for better maintainability
Install the bundle via Composer:
composer require zangra/geodis-bundle:^3.0- PHP ^8.1
- Symfony Framework Bundle >= 6.4
- Doctrine Bundle
- Guzzle HTTP Client ^6.5.8 || ^7.8
Enable the bundle in config/bundles.php:
return [
// Other bundles...
GeodisBundle\GeodisBundle::class => ['all' => true],
];Once configured, you can use the provided services to create and manage Geodis shipments. Example service configuration:
services:
GeodisBundle\Manager\GeodisJsonApi:
lazy: trueThen inject GeodisJsonApi into your services or controllers:
use GeodisBundle\Manager\GeodisJsonApi;
class ShippingController
{
public function __construct(private GeodisJsonApi $geodisApi) {}
public function createLabel(): void
{
// Your logic to create a label
}
}
