PHPackages                             ziptied/bedrock - 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. ziptied/bedrock

ActiveLibrary[API Development](/categories/api)

ziptied/bedrock
===============

Azure Commercial Marketplace SaaS integration for Laravel applications.

018PHPCI passing

Since Sep 18Pushed 7mo agoCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

Bedrock for Laravel
===================

[](#bedrock-for-laravel)

Azure Commercial Marketplace SaaS plumbing for Laravel applications. Bedrock replaces the Microsoft SaaS Accelerator with a first-class, testable package that integrates cleanly with Laravel's queues, events, HTTP client, and Cashier-compatible database layout.

 [![Tests](https://github.com/ziptied/bedrock/actions/workflows/tests.yml/badge.svg?branch=main)](https://github.com/ziptied/bedrock/actions/workflows/tests.yml) [![Packagist](https://camo.githubusercontent.com/fbe63e274d51ef7304dc87d5f92ccddffcc1198a23480ee644ad8544e7bd69d1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7a6970746965642f626564726f636b2e7376673f6c6162656c3d7061636b6167697374)](https://packagist.org/packages/ziptied/bedrock) [![Downloads](https://camo.githubusercontent.com/39e028ed76fe5c7a6f4e782543e8b94ac332d20308a0c94e6fa8494bb72b9f98/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7a6970746965642f626564726f636b2e7376673f6c6162656c3d646f776e6c6f616473)](https://packagist.org/packages/ziptied/bedrock) [![PHP Version](https://camo.githubusercontent.com/0f28337083d9c75435e4b9341c6675662003015e5aa9561bff1de2d91b761967/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f7a6970746965642f626564726f636b2e7376673f6c6162656c3d706870)](https://packagist.org/packages/ziptied/bedrock)

Highlights
----------

[](#highlights)

- ✅ End-to-end Azure SaaS fulfillment lifecycle (landing, resolve, activate, webhook operations, and ACK loop)
- ✅ Cashier-compatible schema while remaining framework-agnostic about billing provider
- ✅ Idempotent operation handling with replay protection
- ✅ Optional metering pipeline with batch emission support
- ✅ Hardened webhook verification (HMAC shared secret, IP allow list, mTLS toggle)
- ✅ Action &amp; pipeline architecture with first-class test coverage using Pest and Orchestra Testbench

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

[](#installation)

Install the package via Composer:

```
composer require ziptied/bedrock
```

Publish the configuration and database migrations:

```
php artisan vendor:publish --provider="Ziptied\\Bedrock\\AzureMarketplaceServiceProvider"
php artisan migrate
```

Register your own marketplace provisioner implementation (optional) by binding the `Ziptied\Bedrock\Domain\Contracts\Provisioner` interface in your `AppServiceProvider` or a dedicated service provider.

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

[](#configuration)

All settings live in `config/azure_marketplace.php`:

- **billable\_model** — Fully-qualified class name of the model that represents the billable customer (defaults to `App\Models\User`).
- **route prefix/middleware** — Customize landing and webhook route groups; webhook middleware defaults to `['api']` plus the signed request middleware.
- **OAuth credentials** — Tenant ID, client ID, client secret, and scope for Azure Marketplace APIs.
- **Endpoints &amp; versions** — Override Azure API base URLs or api-version strings if Microsoft introduces breaking revisions.
- **Webhook security** — Shared secret, IP allow list, and optional mutual TLS enforcement.
- **Cashier compatibility** — Controls whether generated tables align with Laravel Cashier naming and columns.
- **Plans &amp; metering** — Describe plan-specific features and configure metering enablement, dimension defaults, and batch size.
- **Logging &amp; redirects** — Choose a log channel and the redirect path after landing flow activation.

Environment variables such as `AZURE_MP_TENANT_ID`, `AZURE_MP_CLIENT_ID`, `AZURE_MP_CLIENT_SECRET`, `AZURE_MP_WEBHOOK_SECRET`, and `AZURE_MP_ROUTE_PREFIX` can be set to tailor behavior per environment.

Usage Overview
--------------

[](#usage-overview)

- **Landing Flow**: `LandingController` orchestrates resolve → provision → activate using the `LandingResolveActivatePipeline`.
- **Webhook Handling**: `WebhookController` validates signatures, ensures idempotency, dispatches specific action handlers, and optionally triggers the ACK loop.
- **Actions**: Each marketplace behavior (`ActivateSubscriptionAction`, `ApplyChangePlanAction`, `EmitMeteringBatchAction`, etc.) is encapsulated in a dedicated, easily testable action class.
- **Events**: Lifecycle hooks such as `SubscriptionResolved`, `PlanChanged`, and `QuantityChanged` enable application-level integrations.
- **Metering**: When enabled, `EmitMeteringBatchAction` (and the accompanying console command) submit batched usage events to Microsoft and persist responses for auditing.

Refer to the `tests/` directory for example-driven documentation of each action.

Testing
-------

[](#testing)

The project ships with a comprehensive Pest suite.

```
composer test
```

Tests execute inside an in-memory SQLite database via Orchestra Testbench. Custom migrations for your application can be placed under `tests/database/migrations` and will be executed automatically.

Contributing
------------

[](#contributing)

1. Fork the repository and create a feature branch.
2. Run `composer install` and `composer test` locally.
3. Adhere to PSR-12 coding standards and the existing action/pipeline architecture.
4. Include Pest tests for any new or modified actions.
5. Submit a pull request describing your changes.

License
-------

[](#license)

Bedrock is open-sourced software licensed under the [MIT license](LICENSE).

###  Health Score

17

—

LowBetter than 6% of packages

Maintenance43

Moderate activity, may be stable

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity13

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://www.gravatar.com/avatar/3d8cd16b2bd18ecc43e8f38856289d9cccc3767c39ec7b02e6ddf74fdd57098e?d=identicon)[ziptied](/maintainers/ziptied)

---

Top Contributors

[![ziptied](https://avatars.githubusercontent.com/u/379362?v=4)](https://github.com/ziptied "ziptied (6 commits)")

### Embed Badge

![Health badge](/badges/ziptied-bedrock/health.svg)

```
[![Health](https://phpackages.com/badges/ziptied-bedrock/health.svg)](https://phpackages.com/packages/ziptied-bedrock)
```

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

263103.1M454](/packages/google-gax)

PHPackages © 2026

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