PHPackages                             laravel-gtm/safebase-sdk - 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. laravel-gtm/safebase-sdk

ActiveLibrary[API Development](/categories/api)

laravel-gtm/safebase-sdk
========================

Laravel-ready PHP API SDK boilerplate built with Saloon (template repository).

v0.0.1(1mo ago)032MITPHPPHP ^8.4CI passing

Since Apr 16Pushed 1mo agoCompare

[ Source](https://github.com/laravel-gtm/safebase-sdk)[ Packagist](https://packagist.org/packages/laravel-gtm/safebase-sdk)[ RSS](/packages/laravel-gtm-safebase-sdk/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (1)Dependencies (9)Versions (2)Used By (0)

Saloon API SDK (template)
=========================

[](#saloon-api-sdk-template)

Boilerplate for Laravel-ready PHP API client packages using [Saloon](https://docs.saloon.dev/) v4: connector, optional rate limiting, Laravel service provider, Pest, PHPStan, and Pint.

This repository is intended to be used as a [GitHub template](https://docs.github.com/en/repositories/creating-and-managing-repositories/creating-a-repository-from-a-template). After you create a new repository from it, customize the package identity and class names with the one-time init script below (it deletes itself after a successful run).

Requirements
------------

[](#requirements)

- PHP `^8.4`
- Laravel `^11.0 || ^12.0 || ^13.0` (for the optional Laravel integration)

AI and editor rules
-------------------

[](#ai-and-editor-rules)

This template includes the same rule layout as the `luma-sdk` package: [`.claude/rules/`](.claude/rules/) (`saloon.md`, `php-package-phpstan.md`, `laravel-package.md`) for Claude Code, and [`.cursor/rules/`](.cursor/rules/) (`.mdc` mirrors with `globs` front matter) for Cursor. The Laravel rules file notes that **this repo uses `laravel/pint` in `require-dev`** and `composer lint` / `composer format`, which differs from the optional “global Pint only” wording elsewhere in that document.

[Laravel Boost](https://github.com/laravel/boost)-style helpers live under [`resources/boost/`](resources/boost/): [`guidelines/core.blade.php`](resources/boost/guidelines/core.blade.php) (stub) and two skills — a one-time **[`safebase-sdk-initial-setup`](resources/boost/skills/safebase-sdk-initial-setup/SKILL.md)** skill that generates API-specific content, and a **[`safebase-sdk-development`](resources/boost/skills/safebase-sdk-development/SKILL.md)** skill (stub until the initial-setup skill is run). The init script renames both skill folders to use your package slug (`{package-slug}-initial-setup` and `{package-slug}-development`).

[CLAUDE.md](CLAUDE.md) at the repo root summarizes commands, checks, and architecture; run `./init-saloon-sdk.sh` once after creating a new repo so names in that file match your package.

First-time setup (after “Use this template”)
--------------------------------------------

[](#first-time-setup-after-use-this-template)

1. Clone your new repository and install dependencies:

    ```
    composer install
    ```
2. Run the initializer at the repo root. It will prompt for:

    - **Composer vendor** — replaces `laravel-gtm` (e.g. `laravel-gtm`).
    - **Package slug** — replaces `safebase-sdk` everywhere, including the second segment of the Composer name and the config file basename (e.g. `hubspot-sdk` → `laravel-gtm/hubspot-sdk`).
    - **Short class prefix** — PascalCase, **without** `Sdk` on the end; the script adds `Sdk`, `Connector`, and `ServiceProvider` for you (e.g. `Hubspot` → `HubspotSdk`, `HubspotConnector`, `HubspotServiceProvider`).
    - **Env prefix** — replaces `SAFEBASE_` in the published config (e.g. `HUBSPOT_API`).
    - **Default API base URL**.

    The PHP root namespace is derived as `{VendorPascal}{Prefix}Sdk` (e.g. `laravel-gtm` + `Hubspot` → `LaravelGtm\HubspotSdk`). `composer.json` keeps JSON’s doubled backslashes (`\\`) in `autoload` and `extra.laravel.providers`; you do not need to type those.

    ```
    chmod +x init-saloon-sdk.sh
    ./init-saloon-sdk.sh
    ```

    Non-interactive (e.g. CI), same values as environment variables:

    ```
    export COMPOSER_VENDOR='laravel-gtm'
    export PACKAGE_SLUG='hubspot-sdk'
    export SHORT_PREFIX='Hubspot'
    export ENV_PREFIX='HUBSPOT_API'
    export DEFAULT_BASE_URL='https://app.safebase.io'
    ./init-saloon-sdk.sh
    ```

    Preview changes without writing files (`--dry-run` does not delete the script):

    ```
    ./init-saloon-sdk.sh --dry-run
    ```

    After a **successful** full run (Composer install, tests, PHPStan, Pint), `init-saloon-sdk.sh` removes itself so it cannot be applied twice by mistake.
3. Update README badges and repository URLs (Packagist, GitHub Actions) for your package.
4. Replace the example `ExampleGetRequest` / `ping()` flow with real endpoints, DTOs, and resources for your API.
5. Once you have added initial request classes, response DTOs, and resource methods, run the **`safebase-sdk-initial-setup`** Boost skill (via an AI agent) to generate API-specific content for:

    - `resources/boost/skills/safebase-sdk-development/SKILL.md` — comprehensive development guide with real class names, code examples, and testing patterns
    - `resources/boost/guidelines/core.blade.php` — Boost guidelines with setup instructions and code snippets

    This replaces the placeholder stubs with real documentation matching your SDK's structure. After the init script, the skill name will be `{your-package-slug}-initial-setup`.
6. In GitHub: **Settings → General → Template repository** — enable only on the canonical template repo, not on forks meant for production.

Configuration (Laravel)
-----------------------

[](#configuration-laravel)

Publish the config (before init the tag is `safebase-sdk-config`; after init it becomes `{your-package-slug}-config`):

```
php artisan vendor:publish --tag=safebase-sdk-config
```

After running the init script, use your package slug in the tag (e.g. `hubspot-sdk-config`). Env keys use your chosen `ENV_PREFIX` (defaults before init use `SAFEBASE_*`):

- `SAFEBASE_BASE_URL`
- `SAFEBASE_TOKEN`
- `SAFEBASE_AUTH_HEADER`

Usage
-----

[](#usage)

### Via the service container

[](#via-the-service-container)

```
use LaravelGtm\SafebaseSdk\SafebaseSdk;

$sdk = app(SafebaseSdk::class);
```

### Standalone

[](#standalone)

```
use LaravelGtm\SafebaseSdk\SafebaseSdk;

$sdk = SafebaseSdk::make(
    baseUrl: 'https://app.safebase.io',
    token: 'your-token',
);
```

### Example call

[](#example-call)

The template exposes a `ping()` method wired to `GET /v1/ping` — replace this with real API methods.

Development
-----------

[](#development)

```
composer test        # Pest
composer analyse     # PHPStan
composer lint        # Pint (check)
composer format      # Pint (fix)
```

License
-------

[](#license)

MIT. See [LICENSE](LICENSE).

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance89

Actively maintained with recent releases

Popularity7

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 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

Unknown

Total

1

Last Release

54d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/56dcbcd0139adf900f58bc19509e785e6724dadfbfcc74f9c6769432c31686cf?d=identicon)[devethanm](/maintainers/devethanm)

---

Top Contributors

[![devethanm](https://avatars.githubusercontent.com/u/53354219?v=4)](https://github.com/devethanm "devethanm (3 commits)")

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/laravel-gtm-safebase-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/laravel-gtm-safebase-sdk/health.svg)](https://phpackages.com/packages/laravel-gtm-safebase-sdk)
```

###  Alternatives

[saloonphp/laravel-plugin

The official Laravel plugin for Saloon

806.6M184](/packages/saloonphp-laravel-plugin)[codebar-ag/laravel-docuware

DocuWare integration with Laravel

1122.7k](/packages/codebar-ag-laravel-docuware)

PHPackages © 2026

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