Safaribid Docs

PHP SDK

Integrate Safaribid into your PHP, Laravel, or Symfony applications.

PHP SDK

The official Safaribid PHP library is compatible with PHP 7.4+ and provides a native experience for Laravel, Symfony, and other PHP frameworks.

Installation

Install via Composer:

composer require safaribid/safaribid-php

Initialization

require_once('vendor/autoload.php');

$client = new \Safaribid\SafaribidClient([
    'api_key' => 'sk_live_your_key',
    'environment' => 'production'
]);

Usage

Create a Delivery

$delivery = $client->deliveries->create([
    'pickup' => [
        'name' => 'Main Store',
        'address' => 'Central Square, Nairobi'
    ],
    'dropoff' => [
        'name' => 'John Doe',
        'address' => 'Kilimani'
    ],
    'package' => [
        'type' => 'food',
        'weight' => 1
    ],
    'payment_method' => 'wallet'
]);

Laravel Integration

Add the provider and facade (optional) to your config/app.php:

'providers' => [
    Safaribid\Laravel\SafaribidServiceProvider::class,
],

'aliases' => [
    'Safaribid' => Safaribid\Laravel\Facades\Safaribid::class,
],

On this page