PHPackages                             getsendstack/laravel-sendstack - 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. getsendstack/laravel-sendstack

ActiveLibrary[API Development](/categories/api)

getsendstack/laravel-sendstack
==============================

A Laravel Package to work with the SendStack API

1.0.0(2y ago)114233MITPHPPHP ^8.1

Since Aug 19Pushed 2y ago3 watchersCompare

[ Source](https://github.com/getsendstack/laravel-sendstack)[ Packagist](https://packagist.org/packages/getsendstack/laravel-sendstack)[ Docs](https://github.com/getsendstack/laravel-sendstack)[ RSS](/packages/getsendstack-laravel-sendstack/feed)WikiDiscussions main Synced today

READMEChangelog (4)Dependencies (8)Versions (5)Used By (0)

Laravel Send Stack
==================

[](#laravel-send-stack)

[![Latest Version on Packagist](https://camo.githubusercontent.com/934cbc8c21705fc88aebdd8e5fad2a15472c792c4879b25eac93c829d427ede0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f67657473656e64737461636b2f6c61726176656c2d73656e64737461636b2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/getsendstack/laravel-sendstack)[![Test Suite](https://github.com/getsendstack/laravel-sendstack/actions/workflows/tests.yml/badge.svg)](https://github.com/getsendstack/laravel-sendstack/actions/workflows/tests.yml)[![Total Downloads](https://camo.githubusercontent.com/41d769b9fafea6317195a7bcf2f0994b801bda327dff113e49e5ebe510d361aa/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f67657473656e64737461636b2f6c61726176656c2d73656e64737461636b2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/getsendstack/laravel-sendstack)

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

[](#installation)

You can install the package via composer:

```
composer require getsendstack/laravel-sendstack
```

You can publish the config file with:

```
php artisan vendor:publish --tag="sendstack-config"
```

Set up
------

[](#set-up)

To start using this package, you need to add environment variables for:

- `SENDSTACK_URL` - Optional, not really needed as this has a default
- `SENDSTACK_TOKEN` - You can generate this from your getSendStack account.

The package will pick these up in its configuration and use these when it resolves an instance of the `Client`.

Usage
-----

[](#usage)

This package can be used by injecting the `SendStack\Laravel\Http\Client` into a method to instantiate the client:

```
declare(strict_types=1);

use App\Models\Subscriber;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
use SendStack\Laravel\Contracts\ClientContract;

namespace App\Jobs\SendStack;

class SyncSubscribers implements ShouldQueue
{
    use Queueable;
    use Dispatchable;
    use SerializesModels;
    use InteractsWithQueue;

    public function handle(ClientContract $client): void
    {
        foreach ($client->subscribers()->all() as $subscriber) {
            Subscriber::query()->updateOrCreate(
                attributes: ['email' => $subscriber->email],
                values: $subscriber->toArray(),
            );
        }
    }
}
```

Alternatively you can use the Facade to help you:

```
declare(strict_types=1);

use App\Models\Subscriber;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
use SendStack\Laravel\Facades\SendStack;

namespace App\Jobs\SendStack;

class SyncSubscribers implements ShouldQueue
{
    use Queueable;
    use Dispatchable;
    use SerializesModels;
    use InteractsWithQueue;

    public function handle(): void
    {
        foreach (SendStack::subscribers()->all() as $subscriber) {
            Subscriber::query()->updateOrCreate(
                attributes: ['email' => $subscriber->email],
                values: $subscriber->toArray(),
            );
        }
    }
}
```

### Getting a list of Subscribers

[](#getting-a-list-of-subscribers)

```
use SendStack\Laravel\Contracts\ClientContract;
use SendStack\Laravel\Facades\SendStack;

/**
 * Without a Facade
 */
$client = app()->make(
    abstract: ClientContract::class,
);

$client->subscribers()->all();

/**
 * Using the Facade
 */
SendStack::subscribers()->all();
```

### Getting a single Subscriber

[](#getting-a-single-subscriber)

```
use SendStack\Laravel\Contracts\ClientContract;
use SendStack\Laravel\Facades\SendStack;

/**
 * Without a Facade
 */
$client = app()->make(
    abstract: ClientContract::class,
);

$client->subscribers()->get(
    query: '1234-1234-1234-1234' // This can be either the subscribers UUID or their Email Address
);

/**
 * Using the Facade
 */
SendStack::subscribers()->get(
    query: '1234-1234-1234-1234', // This can be either the subscribers UUID or their Email Address
);
```

### Creating a new Subscriber

[](#creating-a-new-subscriber)

```
use SendStack\Laravel\Contracts\ClientContract;
use SendStack\Laravel\Facades\SendStack;
use SendStack\Laravel\Http\Requests\SubscriberRequest;

/**
 * Without a Facade
 */
$client = app()->make(
    abstract: ClientContract::class,
);

$client->subscribers()->create(
    request: new SubscriberRequest(
        email: 'contact@getsendstack.com', // Required
        firstName: 'Send', // Optional
        lastName: 'Stack', // Optional
        tags: [
            'Client',
            'Awesome',
        ], // Optional
        optIn: true, // Optional
    ),
);

/**
 * Using the Facade
 */
SendStack::subscribers()->create(
    request: new SubscriberRequest(
        email: 'contact@getsendstack.com', // Required
        firstName: 'Send', // Optional
        lastName: 'Stack', // Optional
        tags: [
            'Client',
            'Awesome',
        ], // Optional
        optIn: true, // Optional
    ),
);
```

### Update a Subscriber

[](#update-a-subscriber)

```
use SendStack\Laravel\Contracts\ClientContract;
use SendStack\Laravel\Facades\SendStack;
use SendStack\Laravel\Http\Requests\SubscriberRequest;

/**
 * Without a Facade
 */
$client = app()->make(
    abstract: ClientContract::class,
);

$client->subscribers()->update(
    uuid: '1234-1234-1234-1234',
    request: new SubscriberRequest(
        email: 'contact@getsendstack.com', // Required
        firstName: 'Send', // Optional
        lastName: 'Stack', // Optional
        tags: [
            'Client',
            'Awesome',
        ], // Optional
        optIn: true, // Optional
    ),
);

/**
 * Using the Facade
 */
SendStack::subscribers()->update(
    uuid: '1234-1234-1234-1234',
    request: new SubscriberRequest(
        email: 'contact@getsendstack.com', // Required
        firstName: 'Send', // Optional
        lastName: 'Stack', // Optional
        tags: [
            'Client',
            'Awesome',
        ], // Optional
        optIn: true, // Optional
    ),
);
```

### Deleting a Subscriber

[](#deleting-a-subscriber)

```
use SendStack\Laravel\Contracts\ClientContract;
use SendStack\Laravel\Facades\SendStack;

/**
 * Without a Facade
 */
$client = app()->make(
    abstract: ClientContract::class,
);

$client->subscribers()->delete(
    uuid: '1234-1234-1234-1234'
);

/**
 * Using the Facade
 */
SendStack::subscribers()->delete(
    uuid: '1234-1234-1234-1234',
);
```

### Attaching a Tag to a Subscriber

[](#attaching-a-tag-to-a-subscriber)

```
use SendStack\Laravel\Contracts\ClientContract;
use SendStack\Laravel\Facades\SendStack;

/**
 * Without a Facade
 */
$client = app()->make(
    abstract: ClientContract::class,
);

$client->subscribers()->attachTag(
    uuid: '1234-1234-1234-1234',
    tag: 'Early Access',
);

/**
 * Using the Facade
 */
SendStack::subscribers()->attachTag(
    uuid: '1234-1234-1234-1234',
    tag: 'Early Access',
);
```

### Removing a Tag from a Subscriber

[](#removing-a-tag-from-a-subscriber)

```
use SendStack\Laravel\Contracts\ClientContract;
use SendStack\Laravel\Facades\SendStack;

/**
 * Without a Facade
 */
$client = app()->make(
    abstract: ClientContract::class,
);

$client->subscribers()->removeTag(
    uuid: '1234-1234-1234-1234',
    tag: 'Early Access',
);

/**
 * Using the Facade
 */
SendStack::subscribers()->removeTag(
    uuid: '1234-1234-1234-1234',
    tag: 'Early Access',
);
```

### Checking if an email address is an Active Subscriber

[](#checking-if-an-email-address-is-an-active-subscriber)

```
use SendStack\Laravel\Contracts\ClientContract;
use SendStack\Laravel\Facades\SendStack;

/**
 * Without a Facade
 */
$client = app()->make(
    abstract: ClientContract::class,
);

$client->isActiveSubscriber(
    email: 'taylor@laravel.com',
);

/**
 * Using the Facade
 */
SendStack::isActiveSubscriber(
    email: 'taylor@laravel.com',
);
```

### Getting all Tags

[](#getting-all-tags)

```
use SendStack\Laravel\Contracts\ClientContract;
use SendStack\Laravel\Facades\SendStack;

/**
 * Without a Facade
 */
$client = app()->make(
    abstract: ClientContract::class,
);

$client->tags()->all();

/**
 * Using the Facade
 */
SendStack::tags()->all();
```

### Creating a new Tag

[](#creating-a-new-tag)

```
use SendStack\Laravel\Contracts\ClientContract;
use SendStack\Laravel\Facades\SendStack;
use SendStack\Laravel\Http\Requests\TagRequest;

/**
 * Without a Facade
 */
$client = app()->make(
    abstract: ClientContract::class,
);

$client->tags()->create(
    request: new TagRequest(
        name: 'Test', // Required
        allowFormSubscription: true, // Optional
    ),
);

/**
 * Using the Facade
 */
SendStack::tags()->create(
    request: new TagRequest(
        name: 'Test', // Required
        allowFormSubscription: true, // Optional
    ),
);
```

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Steve McDougall](https://github.com/juststeveking)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

31

—

LowBetter than 70% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 71.4% 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 ~92 days

Total

4

Last Release

1036d ago

Major Versions

0.1.1 → 1.0.02023-05-24

### Community

Maintainers

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

---

Top Contributors

[![JustSteveKing](https://avatars.githubusercontent.com/u/6368379?v=4)](https://github.com/JustSteveKing "JustSteveKing (10 commits)")[![mpociot](https://avatars.githubusercontent.com/u/804684?v=4)](https://github.com/mpociot "mpociot (4 commits)")

---

Tags

phpbeyondcodegetsendstacklaravel-sendstacksendstack

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/getsendstack-laravel-sendstack/health.svg)

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

###  Alternatives

[wayofdev/laravel-symfony-serializer

📦 Laravel wrapper around Symfony Serializer.

2112.1k](/packages/wayofdev-laravel-symfony-serializer)

PHPackages © 2026

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