PHPackages                             amribrahim34/bosta-laravel - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. amribrahim34/bosta-laravel

ActiveLibrary[HTTP &amp; Networking](/categories/http)

amribrahim34/bosta-laravel
==========================

this package is for integration with Egyptien curior bosta

015PHP

Since Aug 5Pushed 1y ago1 watchersCompare

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

READMEChangelog (1)DependenciesVersions (1)Used By (0)

Laravel Bosta Egypt
===================

[](#laravel-bosta-egypt)

Description
-----------

[](#description)

A Laravel package for integrating with Bosta shipping services in Egypt

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

[](#installation)

1. Install the package via composer: ```
    composer require amribrahim34/laravel-bosta-egypt

    ```

Configuration
-------------

[](#configuration)

1. Publish the config file: ```
    php artisan vendor:publish --provider="YourNamespace\BostaEgypt\BostaEgyptServiceProvider"

    ```
2. Add your Bosta API key to your .env file: ```
    BOSTA_API_KEY=your_api_key_here

    ```

Usage
-----

[](#usage)

### Basic Usage

[](#basic-usage)

```
use YourNamespace\BostaEgypt\BostaEgypt;

$bosta = new BostaEgypt(config('bosta-egypt.api_key'));
```

### Examples

[](#examples)

#### Calculate Shipment Price

[](#calculate-shipment-price)

```
$result = $bosta->pricing->calculateShipment([
    'dropOffCity' => 'cairo',
    'pickupCity' => 'cairo',
    'cod' => 500,
    'size' => 'Normal'
]);
```

#### Create Delivery

[](#create-delivery)

```
$deliveryData = [
    'type' => 10,
    'specs' => [
        'packageType' => 'Parcel',
        'size' => 'MEDIUM',
        'packageDetails' => [
            'itemsCount' => 2,
            'description' => 'Desc.'
        ]
    ],
    // ... other delivery details
];

$result = $bosta->deliveries->create($deliveryData);
```

Available Methods
-----------------

[](#available-methods)

### Pricing

[](#pricing)

- calculateShipment

### Deliveries

[](#deliveries)

- create

DeliveryBuilder Usage
---------------------

[](#deliverybuilder-usage)

The `DeliveryBuilder` class provides a fluent interface to build delivery data for Bosta Egypt.

### Example

[](#example)

```
