PHPackages                             shippulse/laravel-bosta - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. shippulse/laravel-bosta

ActiveLibrary

shippulse/laravel-bosta
=======================

laravel-bosta

31.3k↓50%1PHP

Since Feb 14Pushed 3mo agoCompare

[ Source](https://github.com/shippulse/laravel-bosta)[ Packagist](https://packagist.org/packages/shippulse/laravel-bosta)[ RSS](/packages/shippulse-laravel-bosta/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Laravel Bosta Shipping Integration
==================================

[](#laravel-bosta-shipping-integration)

This package provides a Laravel integration for the Bosta shipping API, enabling you to easily create, track, label, and cancel shipments programmatically. It is designed for e-commerce platforms and businesses that need to automate shipping workflows with Bosta in Egypt.

Installation
------------

[](#installation)

Install via Composer:

```
composer require shippulse/laravel-bosta
```

ShipmentData Method
-------------------

[](#shipmentdata-method)

```
use Obelaw\Shippulse\Bosta\Entry\Account;
use Obelaw\Shippulse\Bosta\Entry\DropOffAddressData;
use Obelaw\Shippulse\Bosta\Entry\PickupAddressData;
use Obelaw\Shippulse\Bosta\Entry\ReceiverData;
use Obelaw\Shippulse\Bosta\Entry\ShipmentData;
use Obelaw\Shippulse\Bosta\Facades\Bosta;

$shipment = Bosta::setConfig(new Account('email', 'password'))->createShipment(new ShipmentData(
        type: 10,
        cod: 999,
        receiverData: new ReceiverData(
            firstName: 'Ahmed',
            lastName: 'Ali',
            phone: '01001234567',
            email: 'ahmed.ali@example.com',
        ),
        pickupAddressData: new PickupAddressData(
            city: 'Cairo',
            zone: 'Nasr City',
            districtId: 'aiJudRHeOt',
            firstLine: '50 Abbas El Akkad Street',
            buildingNumber: '50',
            floor: '3',
            apartment: '10',
        ),
        dropOffAddressData: new DropOffAddressData(
            city: 'Giza',
            zone: 'Mohandessin',
            districtId: 'aiJudRHeOt',
            firstLine: '123 Gameat El Dewal Al Arabeya',
        ),

    ));
```

### Methods available on CreateShipmentResource

[](#methods-available-on-createshipmentresource)

After calling `createShipment`, you get an instance of `CreateShipmentResource`. You can use the following methods:

- `$shipment->getMessage();` - Get the API message
- `$shipment->getShipmentId();` - Get the shipment ID
- `$shipment->getTrackingNumber();` - Get the tracking number
- `$shipment->getSender();` - Get sender info as array
- `$shipment->getCreationSource();` - Get creation source
- `$shipment->getState();` - Get the shipment state (array)
- `$shipment->toArray();` - Get the full response as array
- `echo $shipment;` - Get the full response as pretty JSON

labelShipment Method
--------------------

[](#labelshipment-method)

To print or download the shipment label (AWB PDF), use the `labelShipment` method:

```
use Obelaw\Shippulse\Bosta\Entry\Account;
use Obelaw\Shippulse\Bosta\Facades\Bosta;
$label = Bosta::setConfig(new Account('email', 'password'))->labelShipment($trackingNumber);
```

This returns an array with:

- `url`: Public URL to the PDF label
- `path`: Local storage path to the PDF label
- `trackingNumber`: The shipment tracking number
- `success`: Boolean status
- `message`: API message (if any)

trackShipment Method
--------------------

[](#trackshipment-method)

To track a shipment and get its current state and details, use the `trackShipment` method:

```
use Obelaw\Shippulse\Bosta\Entry\Account;
use Obelaw\Shippulse\Bosta\Facades\Bosta;
$tracking = Bosta::setConfig(new Account('email', 'password'))->trackShipment($trackingNumber);
```

This returns an instance of `TrackShipmentResource` with methods:

- `$tracking->getTrackingNumber();` - Get the tracking number
- `$tracking->getState();` - Get the shipment state (array)
- `$tracking->getSender();` - Get sender info
- `$tracking->getReceiver();` - Get receiver info
- `$tracking->getPickupAddress();` - Get pickup address
- `$tracking->getDropOffAddress();` - Get drop-off address
- `$tracking->getNotes();` - Get shipment notes
- `$tracking->getCOD();` - Get cash on delivery amount
- `$tracking->getType();` - Get shipment type
- `$tracking->getSpecs();` - Get shipment specs
- `$tracking->getCreatedAt();` - Get creation date
- `$tracking->getUpdatedAt();` - Get last update date
- `$tracking->getAttemptCount();` - Get number of delivery attempts
- `$tracking->getSLA();` - Get SLA info
- `$tracking->toArray();` - Get the full response as array

cancelShipment Method
---------------------

[](#cancelshipment-method)

To cancel a shipment, use the `cancelShipment` method:

```
use Obelaw\Shippulse\Bosta\Entry\Account;
use Obelaw\Shippulse\Bosta\Facades\Bosta;
$result = Bosta::setConfig(new Account('email', 'password'))->cancelShipment($trackingNumber);
```

This returns an array with:

- `trackingNumber`: The shipment tracking number
- `success`: Boolean status
- `message`: API message (if any)
- `data`: Additional API data (if any)

getCashCycle Method
-------------------

[](#getcashcycle-method)

To get the cash cycle details for a shipment (e.g., COD status and fees), use the `getCashCycle` method:

```
use Obelaw\Shippulse\Bosta\Entry\Account;
use Obelaw\Shippulse\Bosta\Facades\Bosta;

$cash = Bosta::setConfig(new Account('email', 'password'))->getCashCycle($trackingNumber);
```

This returns an instance of `CashCycleResource` with methods:

- `$cash->getDepositedAt();` - Get the date when money was deposited
- `$cash->getCod();` - Get the COD amount
- `$cash->getBostaFees();` - Get the Bosta fees
- `$cash->toArray();` - Get the full response as array

Funding
-------

[](#funding)

If you find this package useful and would like to support its development, you can sponsor or contribute to the project.

[Sponsor via GitHub](https://github.com/sponsors/obelaw)

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance55

Moderate activity, may be stable

Popularity24

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity12

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/31162701?v=4)[komicho](/maintainers/komicho)[@komicho](https://github.com/komicho)

---

Top Contributors

[![komtcho](https://avatars.githubusercontent.com/u/12757671?v=4)](https://github.com/komtcho "komtcho (17 commits)")

### Embed Badge

![Health badge](/badges/shippulse-laravel-bosta/health.svg)

```
[![Health](https://phpackages.com/badges/shippulse-laravel-bosta/health.svg)](https://phpackages.com/packages/shippulse-laravel-bosta)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
