PHPackages                             biteslote/restapi-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. [API Development](/categories/api)
4. /
5. biteslote/restapi-laravel

ActiveLibrary[API Development](/categories/api)

biteslote/restapi-laravel
=========================

Laravel integration for the biteslote POS connector. Maps your storefront products to POS menu items, forwards web orders to the POS, and receives status webhooks. Built on biteslote/restapi-sdk.

v1.1.0(1mo ago)00proprietaryPHPPHP &gt;=7.4

Since Jun 24Pushed 1mo agoCompare

[ Source](https://github.com/mitjayani/biteslot-restapi-laravel)[ Packagist](https://packagist.org/packages/biteslote/restapi-laravel)[ Docs](https://biteslote.com)[ RSS](/packages/biteslote-restapi-laravel/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (6)Versions (3)Used By (0)

biteslot Laravel Connector
==========================

[](#biteslot-laravel-connector)

Laravel integration for the **biteslot POS connector API**. It solves the core problem of any storefront ↔ POS link: **your website's product IDs and names never match the POS menu-item IDs.** Orders are translated through a mapping table before they reach the POS, so the right items always hit the kitchen.

Built on top of [`biteslot/restapi-sdk`](../php).

```
Website order ──> ProductMapper (biteslot_product_map) ──> POS /v1/orders
   (local id 482)         local 482 → pos_item 1071            { items:[{id:1071,...}] }

```

What you get
------------

[](#what-you-get)

- **Setup wizard** (`/biteslot/setup`) — a built-in, guided UI that maps your products to the POS in three steps, on any platform. No website code required.
- **`biteslot_product_map`** — the authoritative local-product → POS-item link.
- **`biteslot_pos_items`** — a synced snapshot of the POS catalog for the mapping UI and matching by SKU.
- **`ProductMapper`** — translates a cart to POS line items, or throws `UnmappedProductsException` listing exactly which products aren't mapped.
- **`OrderForwarder`** — maps + forwards a cart to the POS, idempotently.
- **`CatalogSync`** + `php artisan biteslot:sync-catalog` — pull the catalog and auto-map by SKU.
- **Webhook receiver** — verified inbound POS webhooks re-dispatched as the `PosWebhookReceived` event so you can sync status back to your order.

The setup wizard
----------------

[](#the-setup-wizard)

Mapping is configured **once during integration setup**, not on every order, so only deliberately mapped products are ever accepted. After install, an admin visits **`/biteslot/setup`** and is guided through:

1. **Select the table that contains your products** — the wizard reads your own database (any table), and you map its columns (id / sku / name / price).
2. **Sync the POS menu** — pulls every BiteSlot product into a local cache; anything with a matching SKU is linked automatically.
3. **Map each product** — pick the matching POS item for each storefront product.

Then orders forward by **mapped POS item id**, so different product names on the two sides never cause a wrong item.

> **Protect the route.** The wizard ships behind `['web']` middleware only. Add your own auth in `config/biteslot-connector.php`:
>
> ```
> 'wizard' => ['middleware' => ['web', 'auth', 'can:manage-biteslot']],
> ```
>
>
>
> Disable it entirely with `'wizard' => ['enabled' => false]` and map via CLI.

Prefer scripts? `php artisan biteslot:import-products` re-imports from the table you chose in the wizard; `php artisan biteslot:sync-catalog` refreshes the POS menu and auto-maps by SKU.

Install
-------

[](#install)

```
composer require biteslot/restapi-laravel
php artisan vendor:publish --tag=biteslot-connector-config
php artisan migrate
```

Credentials live in the SDK config (`config/biteslot-restapi.php`):

```
BITESLOT_API_URL=https://shop.example.com/api/application-integration/v1
BITESLOT_API_KEY=rk_live_xxxxxxxx

# this package
BITESLOT_BRANCH_ID=12              # optional; the key usually already scopes a branch
BITESLOT_ORDER_TYPE=delivery
BITESLOT_WEBHOOK_SECRET=whsec_...  # the endpoint secret you set on the POS
```

1. Map your products
--------------------

[](#1-map-your-products)

Open **`/biteslot/setup`** in a browser and follow the three steps above. That's the whole job — pick your product table, sync the POS menu, map each product.

To do it (or re-do it) from code instead of the UI:

```
use Biteslot\Connector\Models\ProductMap;

ProductMap::link($localProduct->id, $posItemId, $branchId, [
    'local_sku' => $localProduct->sku,
    'pos_name'  => $posItemName,
]);
```

2. Forward an order
-------------------

[](#2-forward-an-order)

```
use Biteslot\Connector\Services\OrderForwarder;
use Biteslot\Connector\Exceptions\UnmappedProductsException;

try {
    $posOrder = app(OrderForwarder::class)->forward([
        'reference'  => $order->id,            // used as the idempotency key
        'order_type' => 'delivery',
        'note'       => $order->notes,
        'items'      => $order->lines->map(fn ($l) => [
            'product_id' => $l->product_id,    // YOUR id — translated for you
            'quantity'   => $l->qty,
            'note'       => $l->note,
        ])->all(),
        'customer'   => [
            'name'  => $order->customer_name,
            'phone' => $order->customer_phone,
            'email' => $order->customer_email,
        ],
    ]);

    // $posOrder['id'] is the POS order id — store it on your order.
} catch (UnmappedProductsException $e) {
    // $e->localProductIds — block checkout / alert an admin
}
```

Retrying with the same `reference` returns the same POS order (idempotent), so a double-submit never creates two orders.

3. Sync status back
-------------------

[](#3-sync-status-back)

Register the webhook endpoint on the POS (API &amp; Integrations → Webhooks) pointing to `https://your-site.com/biteslot/webhook` with events `order.created`, `order.status_changed`, then listen:

```
use Biteslot\Connector\Events\PosWebhookReceived;

Event::listen(function (PosWebhookReceived $e) {
    if ($e->type === 'order.status_changed') {
        Order::where('pos_order_id', $e->orderId())->update(['status' => $e->status()]);
    }
});
```

Why a mapping table (not name matching)
---------------------------------------

[](#why-a-mapping-table-not-name-matching)

- Merchant can rename / re-ID products on either side without breaking orders.
- Unmapped lines fail loudly with the offending IDs — never a silent wrong item.
- Per-product, so Woo + Shopify + this Laravel site can each keep their own map.

###  Health Score

34

—

LowBetter than 74% of packages

Maintenance91

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity35

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.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

45d ago

PHP version history (2 changes)v1.0.0PHP &gt;=8.0

v1.1.0PHP &gt;=7.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/a9336f302f203ba95b3a73afb9d1ab1689b485882ff20bbfb73bc103cb1d1784?d=identicon)[mitjayani](/maintainers/mitjayani)

---

Top Contributors

[![mitjayani](https://avatars.githubusercontent.com/u/34468723?v=4)](https://github.com/mitjayani "mitjayani (9 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/biteslote-restapi-laravel/health.svg)

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

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3345.4M354](/packages/psalm-plugin-laravel)[mike-bronner/laravel-model-caching

Automatic caching for Eloquent models.

2.4k161.4k1](/packages/mike-bronner-laravel-model-caching)[api-platform/laravel

API Platform support for Laravel

58190.1k19](/packages/api-platform-laravel)[pressbooks/pressbooks

Pressbooks is an open source book publishing tool built on a WordPress multisite platform. Pressbooks outputs books in multiple formats, including PDF, EPUB, web, and a variety of XML flavours, using a theming/templating system, driven by CSS.

45844.8k1](/packages/pressbooks-pressbooks)[forjedio/inertia-table

Backend-driven dynamic tables for Laravel + Inertia.js

272.0k](/packages/forjedio-inertia-table)[simplestats-io/laravel-client

Server-side analytics for Laravel that follows the full funnel from visit to registration to payment, attributed to the channel that drove it. Revenue, MRR, churn and ad-spend profit (ROAS/CAC) per channel. GDPR compliant, ad-blocker proof.

5222.6k](/packages/simplestats-io-laravel-client)

PHPackages © 2026

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