PHPackages                             chrisjohnleah/sage-business-cloud-accounting-api-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. chrisjohnleah/sage-business-cloud-accounting-api-laravel

ActiveLibrary[API Development](/categories/api)

chrisjohnleah/sage-business-cloud-accounting-api-laravel
========================================================

Laravel bridge for the Sage Business Cloud Accounting API SDK — service provider, facade, Eloquent token store, artisan commands, and Blade components.

v0.1.0(1mo ago)06MITPHPPHP ^8.3CI passing

Since May 30Pushed 1mo agoCompare

[ Source](https://github.com/chrisjohnleah/sage-business-cloud-accounting-api-laravel)[ Packagist](https://packagist.org/packages/chrisjohnleah/sage-business-cloud-accounting-api-laravel)[ Docs](https://github.com/chrisjohnleah/sage-business-cloud-accounting-api-laravel)[ RSS](/packages/chrisjohnleah-sage-business-cloud-accounting-api-laravel/feed)WikiDiscussions main Synced 1w ago

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

Sage Business Cloud Accounting — Laravel
========================================

[](#sage-business-cloud-accounting--laravel)

[![CI](https://github.com/chrisjohnleah/sage-business-cloud-accounting-api-laravel/actions/workflows/ci.yml/badge.svg)](https://github.com/chrisjohnleah/sage-business-cloud-accounting-api-laravel/actions/workflows/ci.yml)[![Packagist Version](https://camo.githubusercontent.com/d298a3790b3b90e4d87a66bb0fdcd7e78abc8297909e9fede1690261d83066ff/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f63687269736a6f686e6c6561682f736167652d627573696e6573732d636c6f75642d6163636f756e74696e672d6170692d6c61726176656c2e737667)](https://packagist.org/packages/chrisjohnleah/sage-business-cloud-accounting-api-laravel)[![Total Downloads](https://camo.githubusercontent.com/4ec15942137854b27cb18112290a49e2436366a7c87a2a468b9eddf202074dcf/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f63687269736a6f686e6c6561682f736167652d627573696e6573732d636c6f75642d6163636f756e74696e672d6170692d6c61726176656c2e737667)](https://packagist.org/packages/chrisjohnleah/sage-business-cloud-accounting-api-laravel)[![Laravel](https://camo.githubusercontent.com/3e9242504354dbb5afd360f9a1ec114126b2caddb73d9e789d9102c3285d2b05/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c61726176656c2d3131253230253743253230313225323025374325323031332d6666326432302e737667)](https://laravel.com)[![License: MIT](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](LICENSE)

The Laravel bridge for [`chrisjohnleah/sage-business-cloud-accounting-api`](https://github.com/chrisjohnleah/sage-business-cloud-accounting-api). Adds a service provider, a `Sage` facade, an Eloquent token store, artisan commands, and a Blade connect button — so a Laravel app can talk to Sage with zero wiring.

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

[](#requirements)

- PHP 8.3+
- Laravel 11, 12, or 13

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

[](#installation)

```
composer require chrisjohnleah/sage-business-cloud-accounting-api-laravel
php artisan migrate          # creates the sage_tokens table
php artisan vendor:publish --tag=sage-config   # optional
```

Set your Sage Developer app credentials in `.env`:

```
SAGE_CLIENT_ID=...
SAGE_CLIENT_SECRET=...
SAGE_REDIRECT_URI=https://your-app.test/oauth/sage/callback
SAGE_SCOPES=readonly          # or full_access
```

Connecting
----------

[](#connecting)

Render the connect button in a Blade view:

```

```

…or print the URL from the console:

```
php artisan sage:connect
php artisan sage:status        # check the connection
```

In your OAuth callback route, complete the handshake:

```
use ChrisJohnLeah\SageAccounting\Laravel\Facades\Sage;

Route::get('/oauth/sage/callback', function (Request $request) {
    Sage::exchangeCode($request->query('code'), $request->query('state'), session('sage_state'));
    Sage::resolveBusiness();
    return redirect('/dashboard')->with('status', 'Connected to Sage');
});
```

Using it
--------

[](#using-it)

Everything from the core SDK is available through the `Sage` facade — token refresh and pagination are automatic:

```
use ChrisJohnLeah\SageAccounting\Laravel\Facades\Sage;

foreach (Sage::purchaseInvoices()->list(['updated_or_created_since' => $since]) as $invoice) {
    SupplierBill::updateOrCreate(
        ['sage_invoice_id' => $invoice->id],
        [
            'supplier'     => $invoice->contactName,
            'outstanding'  => $invoice->outstandingAmount,
            'due_date'     => $invoice->dueDate,
            'status'       => $invoice->status?->displayedAs,
        ],
    );
}
```

You can also resolve the client directly: `app(\ChrisJohnLeah\SageAccounting\Sage::class)`.

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

[](#configuration)

Publish `config/sage.php` to customise endpoints, scopes, the token table name, and the refresh buffer.

Testing
-------

[](#testing)

```
composer check   # Pint + Larastan (max) + Pest
```

Licence
-------

[](#licence)

MIT © [Chris John Leah](https://github.com/chrisjohnleah). See [LICENSE](LICENSE).

> Not affiliated with or endorsed by The Sage Group plc.

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance89

Actively maintained with recent releases

Popularity5

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity38

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

Unknown

Total

1

Last Release

55d ago

### Community

Maintainers

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

---

Top Contributors

[![chrisjohnleah](https://avatars.githubusercontent.com/u/959104?v=4)](https://github.com/chrisjohnleah "chrisjohnleah (5 commits)")

---

Tags

accountingapi-clientlaravellaravel-packageoauth2phpsagesage-accountingsaloonapilaraveloauth2BridgeAccountingsagesage-business-cloud

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/chrisjohnleah-sage-business-cloud-accounting-api-laravel/health.svg)

```
[![Health](https://phpackages.com/badges/chrisjohnleah-sage-business-cloud-accounting-api-laravel/health.svg)](https://phpackages.com/packages/chrisjohnleah-sage-business-cloud-accounting-api-laravel)
```

###  Alternatives

[laravel/ai

The official AI SDK for Laravel.

1.0k3.2M246](/packages/laravel-ai)[psalm/plugin-laravel

Psalm plugin for Laravel

3345.3M347](/packages/psalm-plugin-laravel)[larastan/larastan

Larastan - Discover bugs in your code without running it. A phpstan/phpstan extension for Laravel

6.5k55.4M9.2k](/packages/larastan-larastan)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9762.4M133](/packages/roots-acorn)[illuminate/queue

The Illuminate Queue package.

20432.6M1.7k](/packages/illuminate-queue)[api-platform/laravel

API Platform support for Laravel

58174.6k17](/packages/api-platform-laravel)

PHPackages © 2026

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