omar-ehab/laravel-aramex is a Laravel package for integrate laravel with aramex web services.
It currently has 1 GitHub stars and 104 downloads on Packagist (latest version v1.0.0).
Install it with composer require omar-ehab/laravel-aramex.
Discover more Laravel packages by omar-ehab
or browse all Laravel packages to compare alternatives.
Last updated
Integrate your Laravel application with Aramex web services
Run the following command to install the latest applicable version of the package:
composer require omar-ehab/laravel-aramex
You can publish the config-file with:
php artisan vendor:publish --provider="omar-ehab\Aramex\AramexServiceProvider" --tag="config"
You can publish the resources files with:
php artisan vendor:publish --provider="omar-ehab\Aramex\AramexServiceProvider" --tag="lang"
After installation, you can add the following variables to your .env file to modify the default values of Aramex API URLs:
BASE_LIVE_URL
BASE_TEST_URL
Default values are:
BASE_LIVE_URL=https://ws.aramex.net/shippingapi.v2
BASE_TEST_URL=https://ws.sbx.aramex.net/shippingapi.v2
This method allows users to get the world countries list.
Aramex::fetchCountries()->run();
This method allows users to get details of a certain country.
Aramex::fetchCountry()
->setCode('PS')
->run();
This method allows users to get all the states within a certain country (country code).
Aramex::fetchStates()
->setCountryCode('AE')
->run();
This method allows users to get all the cities within a certain country (country code). And allows users to get list of the cities that start with a specific prefix. The required nodes to be filled are Client Info and Country Code.
Aramex::fetchCities()
->setCountryCode('AE')
->run();
This method Allows users to search for certain addresses and make sure that the address structure is correct.
Aramex::validateAddress()
->setAddress(
(new Address()) ...
)->run();
This method allows users to get rate for source/destinations shipment.
$source = (new Address()) ... ;
$destination = (new Address()) ...;
$details = (new ShipmentDetails()) ...;
Aramex::calculateRate()
->setOriginalAddress($source)
->setDestinationAddress($destination)
->setShipmentDetails($details)
->setPreferredCurrencyCode('USD')
->run();
This method allows users to create a pickup request.
$source = (new Address());
$contact = (new Contact());
$pickupItem = (new PickupItem());
$pickup = (new Pickup())
->setPickupAddress($source)
->setPickupContact($contact)
->setPickupLocation('Reception')
->setPickupDate(Carbon::now()->timestamp)
->setReadyTime(Carbon::now()->timestamp)
->setLastPickupTime(Carbon::now()->addDay()->timestamp)
->setClosingTime(Carbon::now()->addDay()->timestamp)
->setStatus('Pending')
->setReference1('')
->addPickupItem($pickupItem);
$labelInfo = (new LabelInfo())
->setReportId(9201)
->setReportType('URL');
Aramex::createPickup()
->setLabelInfo($labelInfo)
->setPickup($pickup)
->run();
This method allows you to cancel a pickup as long as it is un-assigned or pending details.
Aramex::cancelPickup()
->setPickupGUID('PICKUP_GUID')
->run();
This method allows users to create shipments on Aramex’s system.
Aramex::createShipments()->run();
This method allows you to inquire about the last reserved range using a specific entity and product group
Aramex::getLastShipmentsNumbersRange()
->setEntity('ENTITY')
->setProductGroup('PRODUCT_GROUP')
->run();
This method allows the user to print a label for an existing shipment.
$labelInfo = (new \OmarEhab\Aramex\API\Classes\LabelInfo())
->setReportId(9201)
->setReportType('URL');
Aramex::printLabel()
->setShipmentNumber('SHIPMENT_NO')
->setLabelInfo()
->run();
This method allows you to reserve a range of shipment numbers.
Aramex::reserveShipmentNumberRange()->run();
This method allows you to schedule the delivery of a shipment at a specified time and place (Longitude and Latitude)
Aramex::scheduleDelivery()->run();
This method allows the user to track an existing pickup’s updates and latest status.
Aramex::trackPickup()
->setReference('PICKUP_NO')
->setPickup('PICKUP') // any number
->run();
This method allows the user to track an existing shipment’s updates and latest status.
Aramex::trackShipments()
->setShipments(['SHIPMENT_NO'])
->run();