petsdeli / aftership-bundle
Offers an easy Symfony DI integration for the official AfterShip PHP SDK.
Installs: 592
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 5
Forks: 0
Open Issues: 0
Type:symfony-bundle
Requires
- php: >=5.6
- aftership/aftership-php-sdk: ^5.0
This package is not auto-updated.
Last update: 2018-06-29 20:31:10 UTC
README
This Symfony bundle offers an easy DI integration for the official AfterShip PHP SDK. The different APIs are exposed as dedicated services.
Installation
- Run the following command to install the bundle
composer require petsdeli/aftership-bundle
- Configure the AfterShip API key and enable the APIs you want to use in your application
# app/config/config.yml pets_deli_aftership: key: f0604c1e-db72-425d-83b1-4958c85c6b67 couriers: true trackings: true notifications: false last_check_point: false
Usage
Get your configured services from the container
/** @var \AfterShip\Couriers $couriers */ $couriers = $container->get('aftership.couriers'); $response = $couriers->detect('EL722485543US');
or inject them in your services as you see fit.
<service id="app.consumer_command" class="AppBundle\Command\TrackingCommand"> <argument type="service" id="aftership.trackings" /> <tag name="console.command" /> </service>