PHPackages                             joeymckenzie/givebutter-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. joeymckenzie/givebutter-laravel

ActiveLibrary

joeymckenzie/givebutter-laravel
===============================

Givebutter API client for Laravel.

0.1.2(10mo ago)01[5 PRs](https://github.com/JoeyMckenzie/givebutter-laravel/pulls)MITPHPPHP ^8.4CI passing

Since Jul 3Pushed 1mo agoCompare

[ Source](https://github.com/JoeyMckenzie/givebutter-laravel)[ Packagist](https://packagist.org/packages/joeymckenzie/givebutter-laravel)[ Docs](https://github.com/joeymckenzie/givebutter-laravel)[ RSS](/packages/joeymckenzie-givebutter-laravel/feed)WikiDiscussions main Synced 1mo ago

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

 [![logo](art/logo.png)](art/logo.png) [![packgist downloads](https://camo.githubusercontent.com/bc59d343d6d658363e79d967297b060de07f6f3c906867b7c619cfb9d88d2b4e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6a6f65796d636b656e7a69652f676976656275747465722d6c61726176656c2e737667)](https://camo.githubusercontent.com/bc59d343d6d658363e79d967297b060de07f6f3c906867b7c619cfb9d88d2b4e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6a6f65796d636b656e7a69652f676976656275747465722d6c61726176656c2e737667) [![ci](https://camo.githubusercontent.com/826fbea6771df00398ed93db7756d53a574f3c47611f52f8f1d93a437a20f491/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6a6f65796d636b656e7a69652f676976656275747465722d6c61726176656c2f72756e2d63692e796d6c3f6272616e63683d6d61696e266c6162656c3d6369)](https://camo.githubusercontent.com/826fbea6771df00398ed93db7756d53a574f3c47611f52f8f1d93a437a20f491/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6a6f65796d636b656e7a69652f676976656275747465722d6c61726176656c2f72756e2d63692e796d6c3f6272616e63683d6d61696e266c6162656c3d6369) [![packgist downloads](https://camo.githubusercontent.com/368f60690372ddbdb433fd2b302c6ae4f0a2d8e8565117446791386151dedccb/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6a6f65796d636b656e7a69652f676976656275747465722d6c61726176656c2f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65)](https://camo.githubusercontent.com/368f60690372ddbdb433fd2b302c6ae4f0a2d8e8565117446791386151dedccb/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6a6f65796d636b656e7a69652f676976656275747465722d6c61726176656c2f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65) [![packgist downloads](https://camo.githubusercontent.com/3e25e07cb3b098db557a9082597c0518786f7c21a3219ce66479d5c09c7411d1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6a6f65796d636b656e7a69652f676976656275747465722d6c61726176656c2e737667)](https://camo.githubusercontent.com/3e25e07cb3b098db557a9082597c0518786f7c21a3219ce66479d5c09c7411d1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6a6f65796d636b656e7a69652f676976656275747465722d6c61726176656c2e737667) [![codecov coverage report](https://camo.githubusercontent.com/190ae612f844ec1306c863bbcb7fb95fafc2f0ec0d4fc6f1f51d4872e372f99d/68747470733a2f2f636f6465636f762e696f2f67682f4a6f65794d636b656e7a69652f676976656275747465722d6c61726176656c2f67726170682f62616467652e7376673f746f6b656e3d394c5a4b315944474b47)](https://camo.githubusercontent.com/190ae612f844ec1306c863bbcb7fb95fafc2f0ec0d4fc6f1f51d4872e372f99d/68747470733a2f2f636f6465636f762e696f2f67682f4a6f65794d636b656e7a69652f676976656275747465722d6c61726176656c2f67726170682f62616467652e7376673f746f6b656e3d394c5a4b315944474b47)

---

> This package was heavily inspired by [openai-php/laravel](https://github.com/openai-php/laravel). Consider giving it a star to support the Laravel community!

🧈 Givebutter for Laravel
========================

[](#-givebutter-for-laravel)

**Givebutter PHP** for Laravel is a PHP API client that allows you to interact with the [Givebutter API](https://docs.givebutter.com). This package provides integration with Laravel for a seamless experience.

> **Note:** This repository contains the integration code of the **Givebutter PHP** for Laravel. If you want to use the **Givebutter PHP** client in a framework-agnostic way, take a look at the [joeymckenzie/givebutter-php](https://github.com/joeymckenzie/givebutter-php) repository.

Table of Contents
-----------------

[](#table-of-contents)

- [Getting started](#getting-started)
- [Usage](#usage)
- [Configuration](#usage)
- [Testing](#testing)

Getting Started
---------------

[](#getting-started)

> **Requires [PHP 8.4+](https://www.php.net/releases/)**

Install Givebutter PHP via [Composer](https://getcomposer.org/):

```
composer require joeymckenzie/givebutter-laravel
```

Then, run the install command:

```
php artisan givebutter:install
```

This will create a `config/givebutter.php` configuration file in your project, which you can modify to your needs using environment variables. A blank environment variable for the Givebutter API key will be appended to your `.env` and `.env.example` files.

```
GIVEBUTTER_API_KEY=...
```

Once the install command finishes, update your `GIVEBUTTER_API_KEY` with an appropriate value. You may use the `Givebutter` facade to access the Givebutter API:

```
use Givebutter\Laravel\Facades\Givebutter;

$response = Givebutter::campaigns()->create([
    'title' => 'Campaign title',
    'description' => 'Campaign description.',
    'end_at' => CarbonImmutable::now()->toIso8601String(),
    'goal' => 10000,
    'subtitle' => 'Campaign subtitle',
    'slug' => 'campaignSlug123',
    'type' => 'collect',
]);

echo $response->data(); // GetCampaignResponse::class
echo $response->id; // 42
echo $response->title; // 'Campaign title'
echo $response->goal; // 10000
echo $response->toArray(); // ['id' => 42, ...]
```

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

[](#configuration)

Configuration is done via environment variables or directly in the configuration file (`config/givebutter.php`).

### Givebutter API Key

[](#givebutter-api-key)

Specify your Givebutter API Key and organization. This will be used to authenticate with the Givebutter API. You can generate an API key within the Givebutter dashboard under the **Integrations** section.

```
GIVEBUTTER_API_KEY=
```

### Givebutter API Base URI

[](#givebutter-api-base-uri)

The base URI for the Givebutter API. By default, this is set to `https://api.givebutter.com/v1`.

```
GIVEBUTTER_BASE_URL=
```

### Request Timeout

[](#request-timeout)

The timeout may be used to specify the maximum number of seconds to wait for a response. By default, the client will time out after 30 seconds.

```
GIVEBUTTER_REQUEST_TIMEOUT=
```

Usage
-----

[](#usage)

For usage examples, take a look at the [joeymckenzie/givebutter-php](https://github.com/joeymckenzie/givebutter-php)repository.

Testing
-------

[](#testing)

The `Givebutter` facade comes with a `fake()` method that allows you to fake the API responses. Fake responses are returned in the order they are provided to the `fake()` method. All responses have a `fake()` method that allows you to easily create a response object by only providing the parameters relevant for your test case.

```
use Givebutter\Laravel\Facades\Givebutter;
use Givebutter\Responses\Campaigns\GetCampaignResponse;
use Givebutter\Testing\Fixtures\Campaigns;

Givebutter::fake([
    GetCampaignResponse::fake(GetCampaignFixture::class, [
        'description' => 'This is an override of the default fixture data.',
    ]),
]);

$campaign = Givebutter::campaigns()->create([
    'title' => 'Campaign title',
    'description' => 'Campaign description.',
    'end_at' => CarbonImmutable::now()->toIso8601String(),
    'goal' => 10000,
    'subtitle' => 'Campaign subtitle',
    'slug' => 'campaignSlug123',
    'type' => 'collect',
]);

expect($campaign->description)->toBe('This is an override of the default fixture data.');
```

Fake responses expect a data fixture as well. Data fixtures are available for each response type. See the [joeymckenzie/givebutter-php](https://github.com/JoeyMckenzie/givebutter-php/tree/main/src/Testing/Fixtures) repository for the available fixture responses.

After the request has been sent, there are various methods to ensure that the expected requests were sent:

```
// assert completion create request was sent
Givebutter::assertSent(Campaigns::class, function (string $method, array $parameters): bool {
    return $method === 'create' &&
        $parameters[0]['title'] === 'Campaign title' &&
        $parameters[0]['description'] === 'This is an override of the default fixture data.';
});
```

For more testing examples, take a look at the [joeymckenzie/givebutter-php](https://github.com/joeymckenzie/givebutter-php#testing) repository.

---

Givebutter PHP for Laravel is an open-sourced software licensed under the **[MIT license](https://opensource.org/licenses/MIT)**.

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance75

Regular maintenance activity

Popularity1

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 84% 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

3

Last Release

313d ago

### Community

Maintainers

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

---

Top Contributors

[![JoeyMckenzie](https://avatars.githubusercontent.com/u/16873254?v=4)](https://github.com/JoeyMckenzie "JoeyMckenzie (21 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (2 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (2 commits)")

---

Tags

api-clientgivebutterlaravelphpapi clientgivebutter

###  Code Quality

TestsPest

Static AnalysisPHPStan, Rector

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/joeymckenzie-givebutter-laravel/health.svg)

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

###  Alternatives

[sunchayn/nimbus

A Laravel package providing an in-browser API client with automatic schema generation, live validation, and built-in authentication with a touch of Laravel-tailored magic for effortless API testing.

29428.0k](/packages/sunchayn-nimbus)[crowdin/crowdin-api-client

PHP client library for Crowdin API v2

611.5M5](/packages/crowdin-crowdin-api-client)[api-platform/laravel

API Platform support for Laravel

59126.4k6](/packages/api-platform-laravel)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

255.2k](/packages/aedart-athenaeum)[ralphjsmit/laravel-helpers

A package containing handy helpers for your Laravel-application.

13704.6k2](/packages/ralphjsmit-laravel-helpers)

PHPackages © 2026

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